users@glassfish.java.net

Re: Running out of memory

From: <glassfish_at_javadesktop.org>
Date: Thu, 26 Aug 2010 10:36:23 PDT

> > <jvm-options>-Xmx200m</jvm-options>
> > <jvm-options>-Xms200m</jvm-options>
>
> based on your information, i Think you must increase
> -Xmx value
> test to use -Xmx1024m

Um...no. Hardly.

The problem is that you may very well be running out of memory on your VPS. Many VPS don't have much (if any) swap, so your 512MB VPS could simply be 512MB. On a system with swap, you could allocate more than your allotment, but it would be swapped out (swapped out java is dead java, not even worth considering...).

With a 200MB heap size, you are going to be using more than 200MB, since it includes not just the heap, but the JVM as well.

Does your application really need 200MB? With the web profile and a "simple" web app, your memory it likely much less than that.

Before starting GF, I would use something like top or free and see how much memory you have free on your VPS with everything but GF running.

Then I would lower the memory settings. Make sure you lower your Permgen size as well, 128M of 200M as permgen is out of whack.

Basically keep tweaking until your app runs or you find you simple don't have enough RAM, and consider what else on the system may be taking up memory.
[Message sent by forum member 'whartung']

http://forums.java.net/jive/thread.jspa?messageID=481087