I wrote a small set of utilities in JOGL that implement 2D PostScript rendering in 3D space, i.e. implemented most of the PostScript path and graphics state operators. So you can create a path and then stroke (including dash, joins, caps, etc.) and fills. Kind of fun. I think this my fourth PS implementation but definitely the first in Java. The resulting path can be rendered in 2D or extruded to make a filled shape. It works very nicely, but then I ran into a problem.
I wrote a simple temperature wave simulation that shows the variation of temperature with depth in the ground, both vertically and over time. Then I run the simulation. Problem is that it generates a LOT of objects, e.g. 300 data points at 10 depths results in 300x10*4 objects. At a modest 20 FPS, this generates 240,000 objects a second. It can run at 35 FPS initially, but after a little while it starts pausing and the rate drops to 10 FPS (QuadCore MacPro).
None of the cores are maxed, so my thought is that it is GC as the heap gets fragmented. I assume it is not GPU bound as I can’t see why it would be. I’ve done a little dumping of the GC data (gc:verbose) but that doesn’t seem to tell me much.
Thoughts? Comments? Am I missing something? I am no Java maven so that is entirely possible.