Grails and OpenVZ VPS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails and OpenVZ VPS

John Moore
Anyone out there using Grails on an OpenVZ VPS successfully? In the
thread "PermGen recommendations for Tomcat deployment" I mentioned some
of the problems I have been having setting PermSize for Tomcat (which is
typically needed with Grails applications, which require more PermGen
space than your average Java apps). I've now determined that it's
largely because of some quirk of memory handling with the OpenVZ VPS I'm
using. Apparently the way OpenVZ works means that Java sees far more
memory available to it than is really available, at least as a
contiguous block, and Tomcat fails to start, with the errors I
mentioned. I have got it to run finally with some slightly raised
PermSize options, with the following line:

JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx640m -XX:PermSize=128m
-XX:MaxPermSize=192m -server"

Given that I should have 2.5Gb RAM, I would have hoped for rather more
to be usable. I was just wondering whether anyone else has run into such
issues before and has found a way to resolve them? Performance-wise I've
no problems with the VPS, it's only this issue of PermGen memory which
is proving vexatious.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

НА: Grails and OpenVZ VPS

ishe
Openvz and others dont have cache-memory. It has only XEN. As I know trouble in it.
Java needs some cash-memory.


----- Исходное сообщение -----
От: John Moore [via Grails] <[hidden email]>
Отправлено: 11 марта 2011 г. 20:44
Кому: ishe <[hidden email]>
Тема: Grails and OpenVZ VPS



Anyone out there using Grails on an OpenVZ VPS successfully? In the
thread "PermGen recommendations for Tomcat deployment" I mentioned some
of the problems I have been having setting PermSize for Tomcat (which is
typically needed with Grails applications, which require more PermGen
space than your average Java apps). I've now determined that it's
largely because of some quirk of memory handling with the OpenVZ VPS I'm
using. Apparently the way OpenVZ works means that Java sees far more
memory available to it than is really available, at least as a
contiguous block, and Tomcat fails to start, with the errors I
mentioned. I have got it to run finally with some slightly raised
PermSize options, with the following line:

JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx640m -XX:PermSize=128m
-XX:MaxPermSize=192m -server"

Given that I should have 2.5Gb RAM, I would have hoped for rather more
to be usable. I was just wondering whether anyone else has run into such
issues before and has found a way to resolve them? Performance-wise I've
no problems with the VPS, it's only this issue of PermGen memory which
is proving vexatious.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




_______________________________________________
If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Grails-and-OpenVZ-VPS-tp3348808p3348808html
To start a new topic under Grails - user, email [hidden email]
To unsubscribe from Grails - user, visit не все содержимое сообщения]
Reply | Threaded
Open this post in threaded view
|

Re: НА: Grails and OpenVZ VPS

John Moore
On 11/03/11 20:35, ishe wrote:
> Openvz and others dont have cache-memory. It has only XEN. As I know
> trouble in it.
> Java needs some cash-memory.
>
>

I've progressed a little with my investigations, and I don't think it's
true to say that Java actually /needs/ cache memory (if by that you mean
swap space - if not, please explain). I've managed to find a set of
values which allow me to run the app OK, with a raised PermGen
allocation, on an OpenVZ VPS. The trick is to make sure that Java
doesn't try to grab more than is really available (and OpenVZ misleads
it, or at least confuses it, to some degree), which means being careful
to set a low enough Xmx value. This is working well for me at the moment:

JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx640m -XX:PermSize=128m
-XX:MaxPermSize=192m -server"

What has been invaluable for me in this is using PSI Probe
(http://psi-probe.googlecode.com/) to monitor actual memory usage. This
has revealed that the PermGen size required isn't actually that high
(around 100Mb), just rather higher than the default value, and it seems
to be remaining pretty static. It'll be interesting to see what happens
tomorrow once the app comes into more intensive use again after the
weekend. With the settings I've got, I'm confident that I won't be
seeing so many PermGen OutOfMemory errors, if at all. It's also revealed
that my app overall doesn't seem to require more than an absolute max of
around 450Mb, so a 1Gb VPS would actually do nicely.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email