Tuning Java on LINUX


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Tuning Java on LINUX
# 1  
Old 06-29-2007
Tuning Java on LINUX

Hi,

Need help in tuning JAVA on LINUX.

From http://www.trutek.com/index.php?id=173 I understand that on Linux operating system with 4GB memory, JVM can be run with maximum memory of 3800m. But I had no luck. Could someone help me in achieving on Red Hat Linux server.

Here is the details of my Linux server.

OS: Red Hat Linux (Linux xyzsrvr 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux)
Java: java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)
RAM: 4GB

I get this below error while instructing JVM to use 3800m.
$ java -Xmn3800m -Xmx3800m xxxxx (Lots of more options)
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

It would be great if someone help me on this.

Thank you,
Crabbie
# 2  
Old 06-29-2007
Quote:
Originally Posted by crabbie_upk
$ java -Xmn3800m -Xmx3800m xxxxx (Lots of more options)
1. what is the total size of physical memory?

2. what is the size of your swap space?

3. what is the amount of free memory plus unused swap space when the operating system is just idling?

4. what is the maximum you can successfully set it to?
# 3  
Old 06-29-2007
Tuning Java on LINUX - My syste info

Hi,

I have provided information requested against each query below.

1. what is the total size of physical memory?
=> 4GB
2. what is the size of your swap space?
=> 2GB
3. what is the amount of free memory plus unused swap space when the operating system is just idling?
=> Not sure how would I find that. However, below is info found at header on running "top" command

top - 13:53:56 up 1 day, 2:41, 6 users, load average: 2.95, 2.84, 2.81
Tasks: 121 total, 4 running, 117 sleeping, 0 stopped, 0 zombie
Cpu(s): 33.2% us, 16.6% sy, 0.1% ni, 50.1% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 4149212k total, 3375016k used, 774196k free, 244924k buffers
Swap: 2097144k total, 0k used, 2097144k free, 2755996k cached


The "free" command yeilds below details on memory usage.
free
total used free shared buffers cached
Mem: 4149212 3374120 775092 0 244844 2755816
-/+ buffers/cache: 373460 3775752
Swap: 2097144 0 2097144

4. what is the maximum you can successfully set it to?
=> Currently I could set upto -Xms2588m -Xmx2588m

Please let me know if you need further information.

Thanks,
Crabbie
# 4  
Old 06-30-2007
Quote:
Originally Posted by crabbie_upk
4. what is the maximum you can successfully set it to?
=> Currently I could set upto -Xms2588m -Xmx2588m
That's quite good already. If you look at

http://java.sun.com/j2se/1.5.0/docs/...aris/java.html

Look at the documentation for these options, it says Linux platforms are limited to around 2GB, or less. Only SPARC may go beyond the figure.

I have read that some environments such as J2EE application server can achieve some advantage with multiple concurrent VMs, but whether you can use that really depends on your environment.

"Pro Java EE 5 Performance Management and Optimization" by Apress is a must-read for you, if you are managing a JavaEE environment.
# 5  
Old 06-30-2007
Quote:
Originally Posted by crabbie_upk
Mem: 4149212k total, 3375016k used, 774196k free, 244924k buffers
Swap: 2097144k total, 0k used, 2097144k free, 2755996k cached
774196+2097144=2871340

which is in the same ball park as your -Xmx2588m

I suggest

(a) try the same in single-user mode with limited daemons running

(b) bigger swap
# 6  
Old 07-02-2007
Thank you so much

Thank you so much for your help.

I will try the mentioned alternatives.

Thanks again.
Crabbie
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Linux

Linux through Java code

Hi How can I write a Java program to execute Linux commands? What is the best approach: Invoking the Linux shell within Java and executing commands or, using the Java APIs to do the stuff. Since it is platform independent, it'll know itself what to do. We need not check which OS the Java... (1 Reply)
Discussion started by: Dorothy
1 Replies

2. Programming

Running a Java program on Linux

Hello, I have a project directory in /home/researcher I have in my project/src three packages:A (contains the main class), B and C and I have 2 jar-files file1.jar file2.jar files in the project/my-jars In Class A I import other classes from the other packages I compiled as follows:... (4 Replies)
Discussion started by: chercheur857
4 Replies

3. Android

Android is Linux (and Java)

In case you did not know, Android 2.1, Éclair, runs on the 2.6.29 Linux kernel. However, the user space it is built atop Dalvik, a Google-designed custom JVM (Java virtual machine). This is pretty interesting, when you think about it. The core of Android is the linux kernel, and the standard... (5 Replies)
Discussion started by: Neo
5 Replies

4. Red Hat

Suggested books / Whitepapers for Linux Performance Tuning

Hi All, I'm looking for good reference books or white papers about Linux Redhat Performance tuning / system tuning. Thanks for any advice. (0 Replies)
Discussion started by: linuxqwer
0 Replies

5. Web Development

MySQL Tuning Tools with mysqltuner.pl and tuning-primer.sh

We have been tuning MySQL lately and I ran accoss two useful tools that you might be interested in: mysqltuner.pl tuning-primer.sh Both of these scripts are quite useful for MySQL tuning. Here is some sample output of mysqltuner.pl >> MySQLTuner 0.9.8 - Major Hayden... (3 Replies)
Discussion started by: Neo
3 Replies

6. UNIX for Dummies Questions & Answers

Linux Programming in JAvA

is it advisible to do Linux Programming in JAVA.. If so, whats the advantage over C++ or C.. Cud anyone also help me out by providing some links in this regard.. Would be highly appreciated.. (1 Reply)
Discussion started by: srikumar_cs
1 Replies

7. UNIX for Dummies Questions & Answers

Java in Linux

DOes any1 know if the java.awt and javax.swing packages are installed in Redhat Linux 9.0 or not??. I have compiled a simple Java program and ran it but the Java programs related to GUI are not working. Can any1 provide some Help?. (4 Replies)
Discussion started by: rahulrathod
4 Replies
Login or Register to Ask a Question