Netiquette · Download · News · Gallery · Homepage · DSSR Manual · G-quadruplexes · DSSR-Jmol · DSSR-PyMOL · DSSR Licensing · Video Overview· RNA Covers

Author Topic: GLH_build() Memory Leak  (Read 43619 times)

Offline clarebonk

  • with-posts
  • *
  • Posts: 9
    • View Profile
GLH_build() Memory Leak
« on: May 15, 2009, 09:11:20 pm »
I took out the printf()s from GLH_build() and hard coded the user-response values that I want, so that I do not have to enter them in every time I run the function.  When I call GLH_build() in a loop, my memory usage increases with each iteration.  I assume this behavior is not wanted.  There seems to be a memory leak somewhere.  I tried looking through the code to make sure the mallocs are all freed, but I have not found any red flags.  Any idea why/where this is happening?

Thanks!

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1650
    • View Profile
    • 3DNA homepage
Re: GLH_build() Memory Leak
« Reply #1 on: May 15, 2009, 11:24:59 pm »
Thanks for reporting the problems you experienced. Could you please be more specific, and better yet, providing me a reproducible example? I will certainly look into it to get it fixed ASAP.

Xiang-Jun

Offline clarebonk

  • with-posts
  • *
  • Posts: 9
    • View Profile
Re: GLH_build() Memory Leak
« Reply #2 on: May 22, 2009, 01:14:14 am »
Xiang-jun,  I just sent you an e-mail with an example.  I hope this helps.  Thanks so much.  I'm calling GLH_build an insane number of times, which is the only reason this matters.  But, I'm getting good results!  It is a great software suite.

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1650
    • View Profile
    • 3DNA homepage
Re: GLH_build() Memory Leak
« Reply #3 on: June 01, 2009, 07:00:27 pm »
I have fixed the memory leak bugs in file rebuild.c. I have also taken this opportunity to tidy up the code base a little bit. Please download the updated version and verify that the bugs are indeed gone.

Thanks,

Xiang-Jun

Offline clarebonk

  • with-posts
  • *
  • Posts: 9
    • View Profile
Re: GLH_build() Memory Leak
« Reply #4 on: June 03, 2009, 09:55:46 pm »
It took me awhile to incorporate the new code into my code and to perform regression testing, but it is working perfectly.  No memory leak!  Thanks Xiang-Jun!!

 

Funded by X3DNA-DSSR, an NIGMS National Resource for Structural Bioinformatics of Nucleic Acids (R24GM153869)

Created and maintained by Dr. Xiang-Jun Lu, Department of Biological Sciences, Columbia University