CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

Memory leak in OpenFOAM?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2010, 10:52
Default Memory leak in OpenFOAM?
  #1
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
It looks like OpenFOAM has a memory leak.

I ran scalarTransportFoam on the swirlTest tutorial, set the timestep to 0.1, end time to 1000, write interval 1. As it ran I watched the process monitor. Memory use climbed slowly and steadily from 400 mb to 500 mb before I finally stopped the simulation. Why would this be?

This happened on an old revision of 1.5-dev, as well as 1.6. I don't have 1.7 installed yet.

I started looking into this because my custom solver seems to have a bad case of the memory leaks.

Any ideas?
marupio is offline   Reply With Quote

Old   September 21, 2010, 13:37
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
I have confirmed this is a legitimate memory leak. It is case directory dependent - I can only duplicate it using the old swirlTest tutorial from OpenFOAM-1.5. (It doesn't happen for pitzDaily.)

I have isolated it to:
runTime.write();

Enjoy!
marupio is offline   Reply With Quote

Old   September 22, 2010, 05:25
Default
  #3
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
Did you try running it through valgrind? If your OF is compiled for debugging it will even tell you the offending code lines:

valgrind --tool=memcheck --leak-check=yes scalarTransportFoam
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   September 22, 2010, 05:34
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
So scalarTransportFoam on pitzDaily is fine. There appears to be a small leak in bubbleFoam however.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   September 22, 2010, 10:11
Default
  #5
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Interesting. Since you mention that you've isolated the problem to runTime.write(), I'm curious to see whether the leak depends on the write mode (ascii/binary) and/or precision.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   September 22, 2010, 10:35
Default
  #6
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
It might not be present in OF1.7.x - Henry ran my test case and valgrind reported nothing for him.

It's just the old swirlTest tutorial from 1.5... if no one else can duplicate it, it's my machine.

I also found the source of the (big) leak in my custom solver - you can't use a single fvMeshSubset object to produce more than one submesh, or else you lose a mesh-sized chunk of memory.
marupio is offline   Reply With Quote

Old   September 28, 2010, 10:15
Default
  #7
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
We've finally got a proper bug reporting system :-)
Please report any OpenFOAM bugs on http://www.openfoam.com/bugs.

Thanks,

Mattijs
mattijs is offline   Reply With Quote

Old   September 28, 2010, 12:37
Default
  #8
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
Yes I have been informed, and am now registered with Mantis. We should put a sticky announcement at the top of this forum.
marupio is offline   Reply With Quote

Old   October 14, 2010, 13:49
Default
  #9
Member
 
Alex
Join Date: Mar 2010
Posts: 33
Rep Power: 16
bruxellois is on a distinguished road
Hi,

Could you help me please?

check this if you dont mind.

http://www.cfd-online.com/Forums/ope...litiy-how.html


Thanks in advance.

Regards.
bruxellois is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 07:25
autoPtr, derived classes and memory leak johndeas OpenFOAM 1 July 29, 2009 06:29
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 06:56
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25


All times are GMT -4. The time now is 06:53.