Skip to content

Fix memory leak problem

Le Van Truong requested to merge revert-883077ef into master

I have just fixed the memory leak problems showed by valgrind. Here are some notes:

  • To run valgrind efficiently we need to compile the simulator with "-Wall -ggdb3" option.
  • Two mains issues detected by valgrind were:
    • "definitely lost": due to not freed variables.
    • "Conditional jump or move depends on uninitialised value(s)": due to not initialed variables.
  • I have already find all possible variables that can lead to the "definitely lost" and freed it, and I also assigned the initial value to the variables which need it.
  • Now your "DSD.xml" can run without error detected by valgrind. I have also run valgrind with a lot of models to make sure no more memory leak issues could happen. After this merge, if your problem still occur I guess the main issue come from the size of memory chunk for transaction allocation (it is now 8000000 bytes ~= 8 Mbs for each transaction).
  • The test has two executed ways: with and without valgrind.

Merge request reports