Win a copy of Head First Android this week in the Android forum!

Jen Hall

Greenhorn
+ Follow
since Sep 18, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jen Hall

This is interesting. So, we rebooted the machine and voila! I can get 1024M min and 2048M max on Tomcat and Java.

The machine had been up for 728 days, a bit too long eh?

So perhaps it was as simple as that.

Thanks,
Jen
9 years ago
What the support from our hosting compnay suggested is that Java is looking for contiguous blocks of memory and may not be able to find it on the machine. I don't know enough about Linux memory to be of any use on how to configure Java to use what Linux might offer at this point.

So, yes I'd appreciate it if you could move this to the Linux forum since this isn't a Java-specific problem. Thank you!
9 years ago
They replied that there should be no limits on the java processes on that machine. They are going to look a little bit into it as well.
9 years ago
I asked them about not being able to actually use the java they installed, and they just said that it was in my hands to change the Java configuration settings.

However, I will ask them specifically if there is any max memory setting for java, but I do doubt it since it's our server -- though they do do some of the installs and keep the WHM/Cpanel and software current, etc.


9 years ago
Hi all,

We have a dedicated redhat server for web applications at work:
Linux version 2.6.18-194.11.3.el5.cve20103081 (root@lxslc5-amd64.cern.ch) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Thu Sep 16 15:17:10 CEST 2010

Here's what the memory usually looks like (we usually have about 2.7GB in cache, 4GB total)
free -m
total used free shared buffers cached
Mem: 3951 3855 95 0 248 2523
-/+ buffers/cache: 1083 2868
Swap: 2047 26 2020

Our hosting company installed openjdk 1.6 and tomcat 5.5 for me. When I went in to check the java version, this is what happened:

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

So I put on some low min and max heap sizes and tried again and this time it worked:

java -Xms64m -Xmx64m -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

So I tried continually going up in the sizes until I reached this maximum.

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

And then these are the max settings I can set for Tomcat and Java options in the setenv.sh file of Tomcat. If I go higher, it does a dump and produces an hs_pid file.
export CATALINA_OPTS="-Xms128m -Xmx128m -d64 -XX:PermSize=64m -XX:MaxPermSize=6$
export JAVA_OPTS="-Xms128m -Xmx128m -d64 -XX:PermSize=64m -XX:MaxPermSize=64m"

So, my questions are: why do I only have a maximum of 512M for -version and 128M for Tomcat when there is 2.7GB supposedly available in the cache for applications such as java? Is there some other setting that I need to set? How can I get at some more of that memory?

Thank you much,
Jen
9 years ago