This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Memory problem
- From: "Boehm, Hans" <hans dot boehm at hp dot com>
- To: "Gabriel Bianco" <gabriel dot bianco at pixeon dot com dot br>, <java at gcc dot gnu dot org>
- Date: Thu, 8 Dec 2005 15:08:34 -0800
- Subject: RE: Memory problem
> From: Gabriel Bianco
> Hello, I'm new here... :-)
>
> I have three questions...
>
> First, is the memory allocated to the VM ever released or
> does it keep reusing it, but only releases it to the OS when
> the program exits?
Correct in standard configurations. The collector supports -DUSE_MUNMAP
which changes that. Some people find it useful, but I'm not very happy
about the way it's currently implemented. And it only works on some
platforms (notably Linux).
>
> Second, when I start a Java thread from C++ code do I need to
> do anything else before I start it, something similar to
> JvAttachCurrentThread\JvDetachCurrentThread?
That's a standing issue. Currently it's not recommended that you create
a thread from C++ code and then run Java in it. At least if the thread
creation is done in a library outside your control, so that it can't be
turned into a GC_pthread_create. We're slowly moving towards a
solution.
>
> And third, is there a way to set the maximum heap size?
See
http://gcc.gnu.org/viewcvs/trunk/boehm-gc/doc/README.environment?rev=859
72&view=markup for one way.
That may have other negative consequences however.
>
> Our application seems to be using much more memory than we
> think it should...
There is another outstanding issue related to the overly large root size
seen by the collector that impacts this. I believe that's also being
worked on.
Hans
>
> Thanks,
> Gabriel Bianco
>
>