LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 04-01-2009, 08:15 AM   #1
the182guy
Member
 
Registered: Jan 2009
Posts: 40

Rep: Reputation: 15
Can't start the Java Virtual Machine - memory problem?


Hi all,

Basically I can't start the JVM on a remote dedicated Debian server. I am using SSH to issue the commands, there is no desktop UI.

The error I'm getting is:
Code:
Error occurred during initialization of VM
Could not reserve enough space for object heap
When I check memory usage, there seems to be plenty available, but no swap:
Code:
             total       used       free     shared    buffers     cached
Mem:          3937        248       3688          0          0          0
-/+ buffers/cache:        248       3688
Swap:            0          0          0
What I'm actually doing is trying to run "Liferay Portal" which is an application that runs under Tomcat. When I execute the startup.sh the above error can be found in the log.

Any help is appreciated, thanks!
 
Old 04-01-2009, 09:24 AM   #2
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
Sounds like the initial size of the heap, specified with -Xmx is too large for your machine. Look in the catalina.sh to see if there is a value specified. It should be assigned to the JAVA_OPTS variable.
 
Old 04-01-2009, 09:42 AM   #3
the182guy
Member
 
Registered: Jan 2009
Posts: 40

Original Poster
Rep: Reputation: 15
crabboy, thanks for your suggestion.....

the catalina.sh script calls a script that runs this command (sets environment variables):

Code:
JAVA_OPTS="$JAVA_OPTS -Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=$CATALINA_HOME/conf/jaas.config -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false"
There's the value of xmx that you mentioned above.
 
Old 04-02-2009, 08:49 AM   #4
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
You can try a lower number like 512M and see if it helps, but I don't see a problem with the way it is now. That allows the JVM to start small and allocate up to 1G of RAM. What version of java are you using?

java --version
 
Old 04-03-2009, 03:54 AM   #5
the182guy
Member
 
Registered: Jan 2009
Posts: 40

Original Poster
Rep: Reputation: 15
thanks crabboy,

I tried lowering it to a lot of different values. 512M did get past the first VM error and it tried to start, but it went on to have more memory problems 'Cannot allocate memory'. The Liferay software wasn't functional - tried to get to the portal homepage on localhost:8080 but it just hung.

A couple of times the server went unstable, refusing all commands and eventually kicking me out of SSH and not letting me back on. Had to log onto plesk to kill the java process before it would let me back on SSH.

Edit: java version is latest (6.x I think), I downloaded and installed the latest JRE and JDK.

Oh also.. I actually think it might be a Fedora server now, but not 100% sure.

Last edited by the182guy; 04-03-2009 at 03:56 AM.
 
Old 04-03-2009, 01:16 PM   #6
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
does the user that you're using have any ulimits set?

$ ulimit -a

If there are memory limits, set them to unlimited. I don't see why the system would hang and you'd get thrown out though. What does top look like when you start tomcat?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Virtual Machine nodnarb Linux - Software 1 07-19-2004 05:41 PM
Java Virtual Machine zexter Linux - Software 1 11-30-2003 05:28 PM
Problem with Native Java Virtual Machine complus Linux - Software 8 09-22-2003 01:42 PM
Anyone Know where I can get a Java Virtual Machine? pmorkert Linux - Software 2 07-30-2003 12:17 AM
java virtual machine infamous41md Linux - Newbie 6 04-20-2003 12:16 AM


All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration