This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Add methods to GCInfo to allow GC_free_space_divisor to be manipulated.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]