Jump to content

Recommended Posts

I have a VPS package with 512MB of RAM and plenty of bandwidth and HDD space.  Along with the regular LAMP services I want to install Tomcat so PHP can interface with a Java report writer.  The server sits at approximately 100 to 120MB of free memory and every time I consistently get this output:

 

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

 

In another forum, it was suggested to limited the memory java tried to use:

@ java -Xms4m -Xmx8m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

 

But I still get the same error.  However, if I first kill apache and then try the above again, it works:

@ apachectl stop
/usr/local/sbin/apachectl stop: httpd stopped
@ java -Xms4m -Xmx8m -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Server VM (build 1.5.0_12-b04, mixed mode)

 

I haven't even set tomcat up yet and it appears I'm hitting memory limits.  Is it time to jump up to a dedicated host with 1GB+ of RAM or do you think I can tweak the server until all is running?  Once I get this running I have no idea how many resources actually generating reports might use and I expect a fair amount of report generation to occur.

 

Server is CentOS 4.5 and I'm currently trying to get a "proof of concept" going on a local CentOS installation using VMWare.  I'm guessing a dedicated host might be necessary, although I'm trying to save as much money for my company as possible because our budget is currently pretty tight.

 

Thanks for any input / suggestions.

Link to comment
https://forums.phpfreaks.com/topic/62889-is-it-time-to-upgrade-my-server/
Share on other sites

I suppose I can ask the host; although when I signed up I asked them about expanding the allocated disk space at some point in the future.  Their response was that, at least for the HDD, I'd need to move from VPS to dedicated.  So I sort of expect the same in regards to memory.

 

Also, I found a lot of threads where people were getting the "Could not allocate heap memory blah blah blah" inside of a VPS.  The problem arises from the JVM detecting the full system's resources and not those allocated to the VPS, so even if they did up my memory, I might still run into issues.

OK.  I've asked the host about upgrading the memory on the VPS; I will have to move to a dedicated server.

 

We are currently paying ~$170 / month in hosting fees for two VPS, one of which is managed.  I'm thinking I can go with their cheapest P4 package, $159 / month with 512MB RAM, with a 512 MB RAM upgrade, another $19 / month.  That would put my company at ~$180 / month for the dedicated and another ~$70 / month for the VPS we use as a test environment.  However, I think it would be best to just create a second user account on the dedicated server and use it as the development area.

 

Basically, use a single dedicated in place of both our VPS packages.  Does this sound like a good route to go to anyone else?

Humm....its all about configing IMO.

 

I have tomcat running fine on a 380MB VPS with no problems.

 

On your VMware Centos install, how much ram did you allocate to it? 512? or is that just for your VPS?

 

This might be an idea also:

get a web hosting company that offers apache and tomcat. Then you should be able to use your tomcat libraries etc.

 

I have taken Rons approach, and it works a charm.

VPS for me, VPS for my bro, VPS for client websites, VPS for dev.

VMware can be installed on Centos from rpms no hassle.

 

-steve

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.