GC_enable_incremental()
Boehm, Hans
hans.boehm@hp.com
Tue Sep 7 21:35:00 GMT 2004
The real-time thread is running Java code?
There are several issues with getting incremental collection to work
in 3.4:
1) There is a bug in pthread_support.c which causes the thread stopping
signal handler to disable signals and the write to a heap object. This
is bad if that object is write protected, something that can happen with
the incremental collector. Hence the "killed" message. This should be
fixed in the CVS trunk. The fix should probably be backported to 3.4,
but it hasn't been. The problem seems to show up only with 2.6 kernels.
2) There hasn't been a systematic effort to get incremental GC debugged
and tested in the context of gcj. This is nontrivial, since it can break
if a system call writes to a pointer-containing section of the heap.
Hence the library has to play by a stricter set of rules.
3) I'm not sure it would help that much, since most of the GC time
in your context (tiny heap, I presume?) is probably spent tracing the
huge root set, and that will still happen with the world stopped.
There are plans to fix this, but it hasn't happened.
I think partial solutions were available a while ago, but I believe
they're not in the official tree.
Depending on your tolerance level, Fixing (3) may get the pause time to
acceptable levels, even without incremental GC.
Other possible solutions you might consider:
- If you know that you have sufficient idle time on a regular basis,
you can manually invoke the collector early, and abort it if it turns
out you have something to do. This should work well for a few
applications, though perhaps not yours.
- If the real-time thread doesn't need to manipulate the Java heap,
you might be able to exempt it from suspension by the GC. There
is currently no official interface to do this, but it's probably
not hard. It's unsafe if the thread allocates or changes pointers
in the Java heap.
Hans
> -----Original Message-----
> From: java-owner@gcc.gnu.org
> [mailto:java-owner@gcc.gnu.org]On Behalf Of
> DHollenbeck
> Sent: Tuesday, September 07, 2004 1:24 PM
> To: java@gcc.gnu.org
> Subject: GC_enable_incremental()
>>> My embedded environment: 3.4.1, pentium 800Mhz, Linux
> kernel 2.6.7, 32
> mb RAM.
>> The GC when operating without "incremental", is stopping a thread of
> mine, one that is elavated to real time policy status, for 57 msecs
> every 5 seconds or so. This is silly putty, not tolerable or useable
> for an embedded environment.
>> Then, trying to go incremental GC, when I call
> GC_enable_incremental()
> the process terminates with a
>> Killed
>> message. Same is true if I simply set the environment variable
> GC_ENABLE_INCREMENTAL=1 before starting the process and do
> not call the
> function GC_enable_incremental().
>> I've written a realtime incremental garbage collector myself in 1996,
> but I have no clue on where or how I could hook it in to
> replace the one
> in place. The documentation for that does jump out at me. Nor do I
> have the time to do it, really. Write barriers, etc.
>> I was hoping to use libgcj, but it seems it may not be up to the task.
>> Please help:
>> ** Has anyone used GC_ENABLE_INCREMENTAL on x86 linux kernel 2.6.x?
>> ** How else can I get rid of the pause to my realtime thread? Source
> filenames please.
>>> Thank you kindly folks,
>> Dick Hollenbeck
>>
More information about the Java
mailing list