public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: Add new _Jv_SetGCFreeSpaceDivisor method to libgcj.
@ 2007-10-21  5:58 David Daney
  2007-10-22  9:26 ` Andrew Haley
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2007-10-21  5:58 UTC (permalink / raw)
  To: Java Patch List

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

As I mentioned previously, GC_free_space_divisor is no longer exported 
from libgcj.so.

Access to this GC tuning parameter is needed on systems where the 
maximum heap size is set.  If GC_free_space_divisor is not set to a 
value larger than its default value of three, the heap can easily get 
fragmented in such a manner that OutOfMemoryErrors are thrown even 
though there is plenty of free memory.

Since the loss of the ability to adjust GC_free_space_divisor is a 
regression, this should be committed even though we are in stage three.

Tested on x86_64-pc-linux-gnu in libjava with no regressions.

OK to commit?

2007-10-20  David Daney  <ddaney@avtrex.com>

    * include/jvm.h (_Jv_SetGCFreeSpaceDivisor): Declare new function.
    * boehm.cc (_Jv_SetGCFreeSpaceDivisor): Define it.


[-- Attachment #2: freespacedivisor.diff --]
[-- Type: text/x-patch, Size: 1004 bytes --]

Index: include/jvm.h
===================================================================
--- include/jvm.h	(revision 129428)
+++ include/jvm.h	(working copy)
@@ -412,6 +412,10 @@ void _Jv_SetInitialHeapSize (const char 
    _Jv_GCSetMaximumHeapSize.  */
 void _Jv_SetMaximumHeapSize (const char *arg);
 
+/* External interface for setting the GC_free_space_divisor.  Calls
+   GC_set_free_space_divisor and returns the old value.  */
+int _Jv_SetGCFreeSpaceDivisor (int div);
+
 /* Free the method cache, if one was allocated.  This is only called
    during thread deregistration.  */
 void _Jv_FreeMethodCache ();
Index: boehm.cc
===================================================================
--- boehm.cc	(revision 129428)
+++ boehm.cc	(working copy)
@@ -465,6 +465,12 @@ _Jv_GCSetMaximumHeapSize (size_t size)
   GC_set_max_heap_size ((GC_word) size);
 }
 
+int
+_Jv_SetGCFreeSpaceDivisor (int div)
+{
+  return (int)GC_set_free_space_divisor ((GC_word)div);
+}
+
 void
 _Jv_DisableGC (void)
 {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: Add new _Jv_SetGCFreeSpaceDivisor method to libgcj.
  2007-10-21  5:58 Patch: Add new _Jv_SetGCFreeSpaceDivisor method to libgcj David Daney
@ 2007-10-22  9:26 ` Andrew Haley
  2007-10-22 17:13   ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Haley @ 2007-10-22  9:26 UTC (permalink / raw)
  To: David Daney; +Cc: Java Patch List

David Daney writes:
 > As I mentioned previously, GC_free_space_divisor is no longer exported 
 > from libgcj.so.
 > 
 > Access to this GC tuning parameter is needed on systems where the 
 > maximum heap size is set.  If GC_free_space_divisor is not set to a 
 > value larger than its default value of three, the heap can easily get 
 > fragmented in such a manner that OutOfMemoryErrors are thrown even 
 > though there is plenty of free memory.
 > 
 > Since the loss of the ability to adjust GC_free_space_divisor is a 
 > regression, this should be committed even though we are in stage three.
 > 
 > Tested on x86_64-pc-linux-gnu in libjava with no regressions.
 > 
 > OK to commit?
 > 
 > 2007-10-20  David Daney  <ddaney@avtrex.com>
 > 
 >     * include/jvm.h (_Jv_SetGCFreeSpaceDivisor): Declare new function.
 >     * boehm.cc (_Jv_SetGCFreeSpaceDivisor): Define it.

Sure.

Incidentally, my ceasing to export GC_* wasn't a particularly well
thought-out decision: I just looked at the symbols we were exporting
and decided on a subset I thought was useful.  Maybe there are some
GC_ symbols that should be exported.  Thoughts?

Andrew.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: Add new _Jv_SetGCFreeSpaceDivisor method to libgcj.
  2007-10-22  9:26 ` Andrew Haley
@ 2007-10-22 17:13   ` David Daney
  0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2007-10-22 17:13 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Java Patch List

Andrew Haley wrote:
> David Daney writes:
>  > As I mentioned previously, GC_free_space_divisor is no longer exported 
>  > from libgcj.so.
>  > 
>  > Access to this GC tuning parameter is needed on systems where the 
>  > maximum heap size is set.  If GC_free_space_divisor is not set to a 
>  > value larger than its default value of three, the heap can easily get 
>  > fragmented in such a manner that OutOfMemoryErrors are thrown even 
>  > though there is plenty of free memory.
>  > 
>  > Since the loss of the ability to adjust GC_free_space_divisor is a 
>  > regression, this should be committed even though we are in stage three.
>  > 
>  > Tested on x86_64-pc-linux-gnu in libjava with no regressions.
>  > 
>  > OK to commit?
>  > 
>  > 2007-10-20  David Daney  <ddaney@avtrex.com>
>  > 
>  >     * include/jvm.h (_Jv_SetGCFreeSpaceDivisor): Declare new function.
>  >     * boehm.cc (_Jv_SetGCFreeSpaceDivisor): Define it.
> 
> Sure.
> 
> Incidentally, my ceasing to export GC_* wasn't a particularly well
> thought-out decision: I just looked at the symbols we were exporting
> and decided on a subset I thought was useful.  Maybe there are some
> GC_ symbols that should be exported.  Thoughts?

I think it is fine.

After adding _Jv_SetGCFreeSpaceDivisor, and with the things in the new 
gnu.gcj.util.GCInfo class I think it is all covered.


David Daney

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-22 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-21  5:58 Patch: Add new _Jv_SetGCFreeSpaceDivisor method to libgcj David Daney
2007-10-22  9:26 ` Andrew Haley
2007-10-22 17:13   ` David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).