Memory Issues

Dec 21, 2011 at 8:02 AM

I have seen several discussions on memory issues with Balder.  I am using it in an extreme case, where we render more then 2000 objects (approx. 50-75 polygons per object).  During rendering, we see the memory spike up about 60-80 MB.  Not a problem, but it never lets go of the resources, and grows by 50MB every render.  I have been able to get some of it back (about 20% of the growth) by implementing finalizers on some of the geometry classes.  Now, it only jumps by 35-40MB every render.

I am trying to locate the references to objects that are being held as well as trying to find a way around the LOH.  Most of the issues revolve around memory allocated for images (about 262KB per image).  These are LARGE objects and will not be GC'd and end up pinned in memory.  A 256 x 256 pixel image ends up in this range.

Can someone help me understand how to find the referneces (or where the refs are actually being held),  solve the LOH problem or help me in correctly using the cache clearing methods that were added some time back...

 

Please help...

Dec 21, 2011 at 10:40 PM

I have added finalizers in many classes clearing memory and other bits.  I found that there were RenderFaces and RenderNormals that were never being released.  I have also added cleanup for many of the materials related operations.  I have found quite a bit of relief in doing this.  I was seeing 30-50 MB growth across ~1500 objects on re-render.  I am now down to 10MB (some of my own issues were cleaned up as well).  The biggest gains came from cleaning up the rendering objects as they expire rather than waiting.

 

I can send more details, as I have been in the midst of an intense memory profiling and cleanup effort for 2 days now...