There was talk some time ago about implementing something along the lines of:
System.gc( int n );
which would tell (ask) the garbage collector to run for at most n milliseconds. This would replace or be used in combination with the Thread.sleep( int n ) call that might appear in gaming loops.
Alternatively there could be a way to ask the GC to run while a buffer strategy is waiting for the video sync to flip buffers. Thus allowing the GC to optimally use the ‘dead’ time in a typical game or animation loop.
Has anymore thought gone into that? Now that we have Ken here, who I read previously worked on the HotSpot team, perhaps he could comment on the feasibility or nudge the appropriate people to make this part of Java 1.5?
I think Jeff indicated that the first case of limiting the GC to N ms was quite doable according to the guys he talked to.