gcj/SWT gc() and memory

Bryce McKinlay mckinlay@redhat.com
Sat Jun 19 20:32:00 GMT 2004


Heitzso wrote:
> I have a SWT 3.0RC app that generates hundreds of
> thousands of small short life objects, plus some larger
> objects. Run under Linux (IBM JRE) or Win (Sun JRE)
> it stabilizes out around 32M. The same code compiled
> to native with gcj stabilizes around 100+M. I need
> to be able to run on old Win98 128M machines so 100+M
> is too large.

On Linux, I've usually found that gcj's heap grows to around the same 
size or smaller than with Sun's JRE. However, your application's 
allocation behaviour may be different, and gcj's collector may have 
different heuristics to balance heap size and performance. Also, the GC 
may perform a bit differently on Windows. You could try limiting the 
heap size to 32M or so using GC_MAXIMUM_HEAP_SIZE. This may slow down 
your application a bit, due to more frequent GC cycles, but would be the 
right thing to do in a memory-constrained environment.
Regards
Bryce


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /