users@glassfish.java.net

Re: Glassfish memory allocation

From: Alexis Moussine-Pouchkine <alexis.moussine-pouchkine_at_oracle.com>
Date: Tue, 12 Oct 2010 14:52:05 +0200

On 11 oct. 2010, at 12:39, glassfish_at_javadesktop.org wrote:

> How is memory allocated on startup of the glassfish server?
>
> For example, if Xms and Xmx are, respectively set at 512 and 1024, does the server initially grab 512 and then grab more as required up to the limit?

That is really up to the JV like for any other java application. You shouldn't really care about this.

> If so, what happens if there isn't any memory available on the OS?

It starts swapping (avoid at all cost).

> I have a situation with the above settings on a Windows server that is often getting an outofmemory error.

There are several OOM errors, is this one for the heap?

> I notice that although the the OS has 4Gb the memory used is about 3.8Gb. Normally glassfish runs with about 600Mb.

Each 32-bit process can address in theory 4GB. In practice a JVM on windows can hit the ceiling at 2GB but that should be enough for you.


> If glassfish then needed another 200+, taking the OS over the 4Gb limit what would happen?

Doesn't this add up to 1GB, no?
Sharing the exact exception stack trace would help I think.

-Alexis

> I suspect that is when the outofmemory error occurs, does that sound right?
>
> Regards,
> Rupert
> [Message sent by forum member 'ruperty']
>
> http://forums.java.net/jive/thread.jspa?messageID=484868
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>