This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Setting memory-chunk-size claimed when free-memory approacheszero?
- From: David Daney <ddaney at avtrex dot com>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: Martin Egholm Nielsen <martin at egholm-nielsen dot dk>, java at gcc dot gnu dot org
- Date: Wed, 24 Nov 2004 10:12:52 -0800
- Subject: Re: Setting memory-chunk-size claimed when free-memory approacheszero?
- References: <co28m6$51a$1@sea.gmane.org> <41A4CB85.80502@redhat.com>
Bryce McKinlay wrote:
>>
>>But neither happens - my application gets terminated by the Linux
>>kernel...
>>
>>Now, the real question: Is there a way to circumvent this? Can I
>>configure the chunk-eating-mechanism so that it does not allocate
>>chunks larger than, say, 100kb at a time...
>
>
>
> GCJ's garbage collector does not, by default, set a maximum heap size.
> This means that it will keep requesting more memory from the system, if
> required, until VM is exhausted. On Linux systems this might mean that
> the kernel kills your application.
>
> The way to avoid this is to set the maximum heap size to the maximum
> amount of memory you want your application to use. You can do this by
> setting the environment variable GC_MAXIMUM_HEAP_SIZE=<bytes>
>
If you do set GC_MAXIMUM_HEAP_SIZE, then you should also probably set the
divisor to a larger value (I forget the exact name of the variable). If
you use the default divisor value with a limited memory setting you can run
into situations where you get OutOfMemoryError which can be eliminated with
a larger divisor. We use a divisor value of 20.
David Daney.