lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Haxby <...@scalix.com>
Subject Re: Websphere and Dark Matter
Date Mon, 22 Jan 2007 15:52:45 GMT
Nadav Har'El wrote:
> On Tue, Jan 16, 2007, Rollo du Pre wrote about "Re: Websphere and Dark Matter":
>   
>> I was hoping it would, yes. Does websphere not release memory back to 
>> the OS when it not longer needs it? I'm concerned that if the memory 
>> spiked for some reason (indexing a large document) then that would 
>> hamper the rest of the OS because it'd hold on to far more memory than 
>> is needed.
>>     
>
> This is a well known, may I say infamous, Java issue. Java could, in theory,
> easily shrink its heap as soon as it needs less memory, because in Java's GC
> model, memory can be moved around so fragmentation is not a problem. But
> unfortunately, the JVM's heap rarely does shrink by default: once the JVM's
> heap grows, it rarely ever shrinks back.
>   
Are you implying that the process memory shrinks, that memory is 
returned to the kernel? I didn't read the page you referenced that way.

I know that if I allocate memory by memory mapping anonymous regions 
with Linux/Unix I can give it back, but is that the technique that JVMs use?

It's not generally a problem though. Provided you have a compacting 
garbage collector (and the Sun Java GC is one) then the unused memory 
will just get paged out. It may be a different story on windows and it's 
certainly a different story on an embedded platform, but releasing 
memory to the kernel under Linux is not generally necessary or desirable.

jch

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message