-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory consumption growth with repeated meshing, especially with Gmsh #298
Comments
To add to this, the Gmsh-related growth occurs even without solving an equation on the mesh, just computing cell centers to get it to create the mesh:
Still yielding rather rapid memory growth: This is not seen with Grid3D at all: Trac comment by jbsnyder on 01-03-2012 at 00:30 |
I can reproduce the problem here, too. Thanks for the clear diagnostics. We will investigate. Trac comment by guyer on 01-03-2012 at 14:09 |
Just to add another note to this, the issue also occurs with GmshGrid2D (and it's certainly not something related to the grids because I originally observed this from arbitrary geometries used with Gmsh3D and was just looking for simplified test cases), and the mesh.cellCenters shown in the previous example is not necessary:
Example Output: Iter: 0[[BR]] Trac comment by jbsnyder on 01-03-2012 at 17:01 |
I'll add a bit more data. I've tried playing around with some of the memory profiling tools available for python, and have a few notes from "pympler" (http://code.google.com/p/pympler/), running the following code and swapping commenting out the first or second lines:
I get the following object counts for GmshGrid2D and UniformGrid2D:
Looking a little further, it looks like the GmshGrid2D objects are ending up as uncollectable garbage in gc.garbage. I believe it has to do with the del destructors, which appears to have been added to handle cleaning up leftover mesh files. I may experiment a bit further to see if there might be a simple fix and patch for this. Trac comment by jbsnyder on 01-03-2012 at 19:08 |
The following change seems to stabilize the memory growth somewhat. I'm not sure whether this opens any holes for mesh files to remain behind since it seems like these weren't getting called before:
Trac comment by jbsnyder on 01-04-2012 at 14:34 |
Applied the patch suggested and it stops the memory leak and doesn't leave any tmp file when running the tests and when running the sample script. UniformGrid2D appears to leak memory when the Trac comment by wd15 on 01-10-2012 at 16:26 |
I'm currently experiencing issues with growing memory usage with FiPy-2.2_dev5097 when generating meshes with Gmsh or gridded meshes then solving problems on that mesh. For 3D gridded meshes, growth is gradual:
Which grows from returning the following on the first iteration:
Iter: 0
MaxRSS: 44640
to the following on the last iteration:
Iter: 199
MaxRSS: 1511112
(this is about 1.5 GB)
It seems to be faster and more extreme with GmshGrid3D reaching the same allocation level at about 5 iterations using the same parameters:
Iter: 0
MaxRSS: 44656
Iter: 5
MaxRSS: 1587540
Iter: 10
MaxRSS: 2726772
Iter: 15
MaxRSS: 3847696
Iter: 20
MaxRSS: 4662136
Iter: 25
MaxRSS: 5347572
(killed after that point.. eventually I get a failure to run Gmsh, returning a null version)
I see similar behavior on Ubuntu 11.04 (GNU/Linux 2.6.38-13-server x86_64) and Mac OS X 10.7 (Darwin Kernel Version 11.2.0, x86_64), numbers above are from Linux. I haven't gone further to try and narrow down what section might be leaking objects that aren't GC'able, but if there are recommendations, I'd be happy to try and track this down further.
It's possible that there is more than one bug or leak, but the fastest rate of growth is certainly associated with Gmsh-generated meshes.
Imported from trac ticket #417, created by jbsnyder on 01-03-2012 at 00:20, last modified: 01-10-2012 at 16:26
The text was updated successfully, but these errors were encountered: