This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Add methods to GCInfo to allow GC_free_space_divisor to be manipulated.
- From: David Daney <ddaney at avtrex dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Thu, 18 Oct 2007 22:08:26 -0700
- Subject: Re: Patch: Add methods to GCInfo to allow GC_free_space_divisor to be manipulated.
- References: <4717B472.4080609@avtrex.com>
David Daney wrote:
Ever since the GC's internal symbols quit being exported by libgcj.so,
it has been impossible to change the GC_free_space_divisor. We need
to be able to tune this value in restricted memory environments to
prevent OutOfMemoryErrors.
This patch adds a couple of methods to the new gnu.gcj.util.GCInfo
class that allow the GC_free_space_divisor parameter to be tuned.
Tested on x86_64-pc-linux-gnu.
OK to commit?
2007-10-18 David Daney <ddaney@avtrex.com>
* gnu/gcj/util/GCInfo.java (checkPermission): Renamed to ...
(checkDumpPermission): ... this and updated references throughout.
(checkParametersPermission, getGCFreeSpaceDivisor,
setGCFreeSpaceDivisor): New methods.
(getGCFreeSpaceDivisor0, setGCFreeSpaceDivisor0): Declare.
* gnu/gcj/util/natGCInfo.cc: Move #includes outside of ifdef block.
(getGCFreeSpaceDivisor0, setGCFreeSpaceDivisor0): New methods.
* gnu/gcj/util/GCInfo.h: Regenerate.
* classpath/lib/gnu/gcj/util/GCInfo.class: Ditto.
After more thought, I think it is a better idea to add a _Jv_???? method
to set the free_space_divisor. We really want to be able to set the
divisor before any memory is allocated by the GC. If we set the divisor
via java code, there will already have been many allocations,
potentially using up too much memory. I will work up a patch to do that
instead.
Consider this patch withdrawn.
David Daney