> Craig Beattie wrote:
> >
> > Would calling the gc each frame an option. many calls to the gc may
> > limit the amount of work it has to do and so spread the delay.
> >
> > just a thought
>
> An interesting one ... or have a thread that calls the gc at periodic
> intervals ...
>
> Does anybody know what kind of overhead is incurred by System.gc(),
> enven if there's nothing to be gc'ed ?
>
> [ wish I had the VM code :( ]
>
To quote an earlier email from Mats Olsson on this topic:
(garbage collection) "increases in time with the amount of memory _used_ -
not the amount of memory that needs garbage collection."
It would seem that the garbage collector spends most of it's time _finding_
the memory to free not in freeing it. System.gc() will just tell the VM to
start looking every frame. I suspect that this will not solve your problem.
Here is a question though.
If the gc runs in it's own thread, wouldn't it be better for animation apps
for the gc to be collecting _all_ the time rather than in fits and starts.
It would mean that everything would be slower, but at least it would be
consistent. Maybe the performance hit wouldn't be worth it. What is the
priority of the gc thread anyway?
Grant Jennings
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/