Forum Problems Installing LAMS: Problem installing on a shared server


 
You may request notification for Problem installing on a shared server.
Search: 

1: Problem installing on a shared server
07/06/07 10:08 PM
[ Reply | Forward ]
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Install failed. Could not verify java installation, check your lams.properties file for the correct JDK_DIR entry, and that you have set your JAVA_HOME and PATH environment variables correctly.
Refer to the readme for help with setting up java for LAMS.


How do I check to see if the environment varialbes are set correctly?

Posted by Rod Spears

2: Re: Problem installing on a shared server
In response to 1 07/08/07 09:44 PM
[ Reply | Forward ]
Rod,

I'm assuming you are using Unix or Linux. Is that correct? If it is Linux, which flavour of Linux (Red Hat, Ubuntu, etc)?

The error you are getting sounds like it is finding Java is starting our little test program, but for some reason it can't get enough memory to run the program. Given that the program is only small, that is odd.

Checking the environment variables
==================================
We suggest setting JAVA_HOME to your java directory (e.g. /usr/bin/java/jdk1.6.0_01/) and putting the Java bin directory (e.g. /usr/bin/java/jdk1.6.0_01/bin) on the PATH setting as it has helped in the past, but the install will often run without them.

Checking what they are set to can vary depending on which shell you are using, but normally I just log into a terminal window (ie the command line) and enter "set" to get all the environment settings.

The JDK_DIR setting is in the lams.properties file, and is normally something like /usr/bin/java/jdk1.6.0_01/.


Checking if Java is trying to take too much memory
==================================================

You mention this is a shared server. If this is the case, I assume you are running inside a virtual server? This is where they set up multiple copies of Linux (or some other operating system) on one big server and each group gets their own copy of Linux to play with.

It appears (from googling) that some of these virtual servers have problems if you don't set a maximum memory size for Java. To check this, do the following:

* Log into the command line and go to the installation directory (ie where you were running install_lams.sh).

* Run the testJava program - this is our little program that you have Java To run it, do:

$JDK_DIR/bin/java -cp bin testJava

Replacing $JDK_DIR with your JDK directory. If you have put the Java bin directory on your path, then you can just do:

  java -cp bin testJava

That should give you the "Could not reserve enough space for object heap" error.

* If it does give you the error, try running this instead:

$JDK_DIR/bin/java -Xmx256m -cp bin testJava

Now does that last version work? If yes, then we will do a new install script that should run for you!

The other possibility is that the virtual server you have been allocated hasn't been allocated enough memory for the installer to run, or the one big server is overloaded. Let us hope that neither of those is the case, as that would mean talking to whoever supplied your shared server!

Fiona

Posted by Fiona Malikoff

3: Re: Re: Problem installing on a shared server
In response to 2 07/10/07 08:40 PM
[ Reply | Forward ]
It is an Apache server.

I am using a Mac terminal - SSH - Bash

Here is what I get for environment settings:

JAVA_HOME=jdk1.6.0_02
PATH=jdk1.6.0_02/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/local/msql/bin:/usr/games:.

I think this is correct because the jdk1.6.0_02 directory is where I installed JDK.

Here is a copy of what I get after running the command as you suggested:
u35483043:~ > java -Xmx256m -cp bin testJava
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Posted by Rod Spears

4: Re: Re: Re: Problem installing on a shared server
In response to 3 07/10/07 09:44 PM
[ Reply | Forward ]
That's interesting... it could be that instead of 'testJava' not getting enough memory, it's asking for too much (and getting denied by the OS running your shared server). If your server has >= 2 CPUs and > 2GB of ram, then running 'java -cp bin testJava' will automatically ask for a minimum amount of memory equal to a fraction of your server's total ram.

http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html

Can you try running it like this:

shell> java -client -cp bin testJava

The client option by default asks for only 2MB initially. If that doesn't work, try

shell> java -Xms1m -cp bin testJava

I'm making the assumption here that your host server is a beefy machine with >= 2 CPUs and > 2GB ram. But if one of these commands works, then it may be that your host is running out of memory for your java apps (= not good for LAMS).

Posted by Jun-Dir Liew

5: Re: Re: Re: Problem installing on a shared server
In response to 3 07/10/07 09:57 PM
[ Reply | Forward ]
Bleah. There goes that theory out the window.

The JAVA_HOME and PATH aren't right - the "jdk1.6.0_02" bit needs a path in front of it. Even it if was in the root directory (which I doubt) it would be "/jdk1.6.0_02".

But I doubt that's the problem, as Java is trying to start but can't get enough memory.

And that version of Java should be fine.

Can you try issuing a few more commands for us? That might give us a clue. At the command line on the server, try the following commands and post the output:

  • uname -a
  • java -v
  • whereis java

    e.g. when I do it on one of our servers I see:

    $ uname -a
    Linux laxxxxxx 2.4.9-e.24smp #1 SMP Tue May 27 16:07:39 EDT 2003 i686 i686 i386 GNU/Linux

    $ java -version
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)

    $ whereis java
    java:

    In this case, whereis didn't find Java. Don't be worried if that happens on your server. It just goes to show that whereis doesn't always know where everything is... But it works on some servers.

    Fiona

    Posted by Fiona Malikoff

  • 6: Re: Re: Re: Re: Problem installing on a shared server
    In response to 5 07/10/07 09:59 PM
    [ Reply | Forward ]
    Sorry Rod - try JunDir's suggestion first. He was a quicker typist than me and I didn't see his response before posting.

    Fiona

    Posted by Fiona Malikoff

    7: Re: Re: Re: Re: Re: Problem installing on a shared server
    In response to 6 07/11/07 02:49 PM
    [ Reply | Forward ]
    Thanks for all the help!

    However, I finally got a response from tech support. My shared server is hosted by 1and1. They told me that the server will not support Java.

    I am not looking for an affordable service that would support it. I am communicating with them about it now to see if they offer something I can afford.

    Their Virtual Private Server may be an option. It is affordable. However, if not, the next step with them would cost too much.

    Any ideas?

    Posted by Rod Spears

    8: Re: Re: Re: Re: Re: Re: Problem installing on a shared server
    In response to 7 07/11/07 02:51 PM
    [ Reply | Forward ]
    I meant to say I am NOW looking for an affordable service.

    Posted by Rod Spears

    Reply to first post on this page
    Back to Problems Installing LAMS