Hi Branden,

  VPS configurations often limit the amount of virtual memory that can be
allocated by processes (e.g. see privmpages in virtuozzo). The JVM is one of
those programs that really loves to allocate large chunks of virtual memory
for all kinds of memory areas it uses without necessarily ever using it.

  There is ways to mitigate this problem though. Apart from the Java heap
you should look into permspace and code cache sizing (speaking SUN JVM only
here). There is VM options to limit both (e.g. -XX:ReservedCodeCacheSize=32m
-XX:MaxPermSize=64m). Also see here in general
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp.

  In order to find suitable numbers, run your application locally, connect
to it with jconsole (see
http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html), and
have a look at the memory mbeans. Make sure to run the app for a moment and
traverse most of its "parts" so that code gets loaded and JIT compiled. Add
a little (say %30) to the used permspace and code cache numbers.

  That worked for me (although not using OFBIZ).

  Good Luck!

hb

On Tue, Mar 31, 2009 at 6:10 PM, Branden Strickland <
[email protected]> wrote:

> All,
>
> It's been a while since I've worked with OFBIZ but the time has come to
> resume working with it.
>
> I know the answer to my question (sort of) but need some guidance from some
> good JAVA guys... (YOU!)
>
> Overview:
> Godaddy's virtual dedicated servers are setup with virtuoso, they alocate
> only the needed memory up to what you have for max (me = 256mb)  This
> should
> be fine as I've gotten a test box with that to run OFBIZ.
>
> I have everything setup; Ant, JDK1.6,ofbiz svn exported.
> Centos 5
>
> When I go to do an ant run-install-seed I get:
>
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
> Could not create the Java virtual machine.
>
> I've inserted an alias into my /etc/profile.d/java.sh (same as bashrc but
> cleaner for CENT/RHEL products) so that I have:
> export JAVA_HOME=/opt/jdk1.6.0_13/jre
> PATH=$PATH:$JAVA_HOME/bin
> alias java='java -Xms2m -Xmx16m'
>
> I'm told the Xms and Xmx will help lower the memory hogging that java wants
> to do, but I'm having little success.  I'm fine with java -version and
> javac
> -version.  So JVM itself is working, but I think it's trying to grab too
> much memory that the virtual server core won't grant me at one time.
>
> Has anyone worked this this type of thing?
>
> Thanks!!
>

Reply via email to