Netiquette · Download · News · Gallery · Homepage · DSSR · Web-DSSR · DSSR Manual · Reproduce DSSR · DSSR-Jmol · DSSR-PyMOL · Web-SNAP

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

Offline clarebonk

  • regular
  • *
  • 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
  • regular
  • *****
  • Posts: 1215
    • 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
Dr. Xiang-Jun Lu [律祥俊]
Email: xiangjun@x3dna.org
Homepage: http://x3dna.org/
Forum: http://forum.x3dna.org/

Offline clarebonk

  • regular
  • *
  • 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
  • regular
  • *****
  • Posts: 1215
    • 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
Dr. Xiang-Jun Lu [律祥俊]
Email: xiangjun@x3dna.org
Homepage: http://x3dna.org/
Forum: http://forum.x3dna.org/

Offline clarebonk

  • regular
  • *
  • 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!!

 

Created and maintained by Dr. Xiang-Jun Lu[律祥俊]· Supported by the NIH grant R01GM096889 · Dr. Lu is currently a member of the Bussemaker Laboratory at the Department of Biological Sciences, Columbia University. The project is in collabration with the Olson Laborarory at Rutgers where 3DNA got started.