my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Java Error occurred during initialization of VM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Error occurred during initialization of VM " Watch "Java Error occurred during initialization of VM " New topic
Author

Java Error occurred during initialization of VM

Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Hi!
I'm trying to install tomcat5 on fedora

I did

yum install tomcat5
/etc/init.d/tomcat5 start

but when I go to http://myip:8080

The tomcat is not running
I can see on the logs:...

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

How can I fix it?
Thanks a lot!
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3223
How much memory have you got in your machine?


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
Natalia Lopez
Ranch Hand

Joined: Feb 17, 2005
Posts: 41
Hi
I have 1 Gb of RAM
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Well...seems like you have an improper installation of Java.

1. Remove Java installation from your machine, install it afresh and try again.

2. Write a simple hello world program and try compiling it. So that you will get more meaningful error message. It is a possibility that some variable is not properly set or something like that. Trace it down and remove.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14270
    
  21

When you run a Java program, you can use the -Xmx switch on the command line to specify how much memory Java can allocate at most. For example, to let Java use up to 256 MB memory, run it like this:

java -Xmx256m com.mypackage.MyProgram

For Tomcat, have a look at the script that you use to start up Tomcat. I don't know exactly what it's called, probably tomcat.bat or catalina.bat in the bin directory of your Tomcat installation directory. You could add the -Xmx setting to the line in that script that starts Tomcat.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
jQuery in Action, 2nd edition
 
subject: Java Error occurred during initialization of VM