Jacks, gij and the GC

Bryce McKinlay mckinlay@redhat.com
Thu Apr 22 15:41:00 GMT 2004

Ranjit Mathew wrote:

>Anyways, to cut a long story short, I have
>these questions:
>1. Doesn't anyone else see this behaviour on Linux?
>2. Why should the GC print out the "GC Warning" if
>   we are throwing an OutOfMemoryError anyway?

It shouldn't. I think we should be able to fix things so that an 
OutOfMemoryError gets thrown correctly, if you have set a maximum heap 
size. Like Andrew says, its harder to get things right when the heap is 
unbounded. I suspect the kernel should probably end up killing your app 
before virtual memory is really exhausted.

>4. Is there an option corresponding to "-mx" to limit
>   the heap size for natively compiled executables?

There is the GC_MAXIMUM_HEAP_SIZE environment variable. However one 
thing I want to add is a GCJ_ARGS environment variable so that you can 
specify runtime arguments when running a gcj compiled application in a 
similar way to what you'd do when running gij. For example:

GCJ_ARGS="-mx=64m" ./mygcjapp



More information about the Java mailing list