Memory problem
Boehm, Hans
hans.boehm@hp.com
Thu Dec 8 23:08:00 GMT 2005
> 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
>>
More information about the Java
mailing list