Welcome! Log In Create A New Profile


Java heap overflow

Posted by Adrian Bowyer 
Java heap overflow
March 18, 2008 05:25PM
The latest Java that I have checked in contains a few things to try to reduce memory usage.

1. All the RepRap geometry code now has a destroy() function that, when called, genocidally goes through it with fire and the sword not only deleting the thing that the function was called for, but also everything to which it links recursively. Not to put too fine a point on it, this function has to be called with care. But when called at the end of printing a layer none of which is needed any more, it should set all the geometry of that layer to point to null, which will allow the garbage collector to get rid of it. That's what I've done.

2. The code now calls System.gc() at the start of the cooling delay, which should give it a hint to get on with a tidy if it is about to need to.

3. You can turn the simulation window off completely by setting the preferences file variable DisplaySimulation false. There are some forums out there that imply that Java3D suffers the same problem that my geometry code did (before I added the destroy() functions...), namely that setting a pointer to a bit of it at the top to null doesn't kill off the tree below as there are so many internal pointers that the system can't tell if the graph is disjoint from the live stuff. The forums imply that this problem goes back to 1998...

Edited 1 time(s). Last edit at 03/18/2008 05:26PM by Adrian Bowyer.

best wishes


Re: Java heap overflow
October 07, 2008 09:15AM
I had the heap overflow problem when printing the minmug using software version reprap-host-src-20080523 and found that on each ring of the mug, with the simulation switched off, I was losing about 20Mbytes. The garbage collect in the betweenLayers() method of Reprap.java did not help because it was called only once during the production of minmug.
I have since looked at the code and see that betweenLayers() method is called only if interlayer cooling is selected.

Edited 1 time(s). Last edit at 10/15/2008 11:36AM by jonwise.
Sorry, only registered users may post in this forum.

Click here to login