public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Erik Groeneveld <erik@cq2.nl>
To: "Boehm, Hans" <hans.boehm@hp.com>
Cc: Andrew Haley <aph@redhat.com>, "java@gcc.gnu.org" <java@gcc.gnu.org>
Subject: Re: GC leaks debugging
Date: Sat, 02 Apr 2011 09:39:00 -0000	[thread overview]
Message-ID: <BANLkTim-j+s4ubQK9=tB=rKw7tKJovq6Uw@mail.gmail.com> (raw)
In-Reply-To: <238A96A773B3934685A7269CC8A8D04272EFEFD5C3@GVW0436EXB.americas.hpqcorp.net>

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

[...]

> Note that in the information you posted, the GC was scanning around 7.5MB of roots conservatively.  It might be worth checking what those regions are.
It seems it come from libgcj.  This is now my minimal program:

#include <gcj/cni.h>
void _Jv_RunGC(void);
int main(int argc, char *argv[]) {
    JvCreateJavaVM(NULL);
    _Jv_RunGC();
    //JvAttachCurrentThread(NULL, NULL);
}

I compile the test with:

g++ -O0 -fPIC -g -o test test.cpp -L../gccinstall/lib -lgcj

And run with:

export GC_DUMP_REGULARLY=1
export GC_BACKTRACES=10
./test

Only linking and initializing GCJ gives the log as attached.  The 7.5
MB root is already present.  And it gives nearly 2000 blacklisting
messages, resulting in a heap with 10 of 12 sections 100% blacklisted
and the other 2 already significantly polluted.

Since the program has yet to begin, it seems that the race is about to
start with one party on a severe penalty. ;-)

> The number of black-listed pages seems really high to me.  Is the collector configured for too small a heap?
I use GCC 4.6 (svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch) and
gc is build with LARGE_CONFIG and PRINT_BLACK_LIST.

> What's the platform?
Linux 2.6.32-5-686-bigmem with 4 GB memory.  I understand that the
changes of misidentifiying pointers are smaller on a 64 bits machine,
so I also ran (lots of) tests on an AMD64 machine, however I got the
same problems with exploding heaps consistently on both architectures.
  I attached a typical explosion graph.

Lastly, I have read this thread about "leak with finalizers"
(http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/748)
and it seems that something quite similar happens with GCJ. I also
tried to explicitly call GC_gcollect as suggested, which delayed but
did not contain the explosion. However, I now think that it might be a
good idea to explore this 7.5 MB root that GCJ is starting out with.

Do you have any hints on how to find the sources of these roots?

Erik

[-- Attachment #2: gc-log.tgz --]
[-- Type: application/x-gzip, Size: 42082 bytes --]

  reply	other threads:[~2011-04-02  9:39 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01  8:39 Erik Groeneveld
2011-04-01  8:45 ` Andrew Haley
2011-04-01  9:03   ` Erik Groeneveld
2011-04-01  9:34     ` Andrew Haley
2011-04-02  0:27       ` Boehm, Hans
2011-04-02  9:39         ` Erik Groeneveld [this message]
2011-04-03 17:15           ` Erik Groeneveld
2011-04-03 18:00             ` Erik Groeneveld
2011-04-04  8:13               ` Andrew Haley
2011-04-04  8:53                 ` Erik Groeneveld
2011-04-04  9:48                   ` Andrew Haley
2011-04-05  4:44                     ` Boehm, Hans
2011-04-05  8:58                       ` Andrew Haley
2011-04-05  6:50                     ` Erik Groeneveld
2011-04-05  9:02                       ` Andrew Haley
2011-04-05 12:02                         ` Erik Groeneveld
2011-04-05 12:55                           ` Andrew Haley
2011-04-06 14:30                             ` Erik Groeneveld
2011-04-06 18:33                               ` Andrew Haley
2011-04-06 18:39                                 ` David Daney
2011-04-07 17:43                                 ` Erik Groeneveld
2011-04-08  8:12                                   ` Erik Groeneveld
2011-04-08 13:56                                   ` Andrew Haley
2011-04-08 15:35                                     ` David Daney
2011-04-08 15:53                                       ` Erik Groeneveld
2011-04-08 15:57                                         ` Andrew Haley
2011-04-08 15:48                                     ` Erik Groeneveld
2011-04-09  1:17                                     ` Boehm, Hans
2011-04-09  8:47                                       ` Andrew Haley
2011-04-09 10:56                                       ` Erik Groeneveld
2011-04-10 11:03                                         ` Erik Groeneveld
2011-04-12 18:43                                           ` Erik Groeneveld
2011-04-13  8:11                                             ` Andrew Haley
2011-04-13 12:11                                               ` Bryce McKinlay
2011-04-13 14:27                                                 ` Andrew Haley
2011-04-14  8:36                                               ` Erik Groeneveld
2011-04-14  8:43                                                 ` Andrew Haley
2011-04-14 10:02                                                   ` Erik Groeneveld
2011-04-14 10:50                                                     ` Andrew Haley
2011-04-15  7:32                                                       ` Erik J Groeneveld
2011-04-01 17:41 ` David Daney
2011-04-02 16:21   ` Erik Groeneveld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTim-j+s4ubQK9=tB=rKw7tKJovq6Uw@mail.gmail.com' \
    --to=erik@cq2.nl \
    --cc=aph@redhat.com \
    --cc=hans.boehm@hp.com \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).