This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GC latency in GCJ
- From: Andrew Haley <aph at redhat dot com>
- To: "P.O. Gaillard" <pierre-olivier dot gaillard at fr dot thalesgroup dot com>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 24 Apr 2006 16:52:26 +0100
- Subject: Re: GC latency in GCJ
- References: <444CF107.5030305@fr.thalesgroup.com>
P.O. Gaillard writes:
> I am testing the latency of programs compiled with GCJ and the GC
> stops everything when it runs (I run Fedora Core 5, GCJ 4.1 and
> Linux Trace Toolkit showed me that all the tasks are suspended
> during GC as described by Hans Boehm in a message on this list).
>
> I would like to test my little test program without GC but could
> not find any runtime option to stop the garbage collector. Do I
> really need to recompile GCC or can I change some runtime parameter
> ?
I don't think so. Hans will have to answer that one. You might get
better results on one of the gc lists.
> Also, I was surprised to see that my test program allocates memory
> all the time (the size shown by ps increases until the gc starts)
> when compiled with gcj. This does not seem to happen with JDK
> 1.5.
I don't understand what you're saying here. Until the gc starts,
memory use increases continuously? What would you expect?
> So I tried to use valgrind, gdb, oprofile to find where _Jv_Malloc
> is called but I ran into problems (like the fact that libgc seems
> to be lacking debugging symbols on my machine).
Well, you have the source. However, _Jv_Malloc is not what you're
looking for: most of the memory is allocated from
GC_local_gcj_malloc or GC_gcj_malloc.
> I would therefore like to ask a few questions on this list :
> 1) where can I find a documentation of the ways to configure the GC
> at runtime (environment variables, calls to C functions etc.) ?
boehm-gc/doc
> 2) is there a way to force the GC to work in 500us/1ms increments ?
I don't think so. You might get better results on one of the gc
lists.
> 3) what is the easiest way to find out where memory is allocated
> with GCJ ? I would like to obtain something like what gnatmem,
> valgrind, jdk (-Xrunhprof:heap=sites) do. That is obtain backtraces
> of the call stack for all the allocation sites in a program.
Every time a piece of memory is allocated, you want the stack trace?
That should be easy enough to add to _Jv_AllocObj and
_Jv_AllocPtrFreeObj, simply by doing a backtrace() and printing the
results to a file somewhere.
Andrew.