tags:

views:

358

answers:

2

we have a solaris sparc 64 bit running the jboss. it has 24G mem. but because of JVM limitation, i can only set to JAVA_OPTS="-server -Xms256m -Xmx3600m -XX:MaxPermSize=3600m". i don't know the exactly cap. but if i set to 4000m, java won't like it.

is there any way to use this 24G mem fully or more efficiently?

if i use cluster on one machine, is it stable? it need rewrite some part of code, i heard.

A: 

you can't use the full physical memory, JVM requires max contined memory trunck, try use java -Xmxnnnnm -version to test the max available memory on your box.

I understand there is a limitation for JVM, whatever it's 32 bit or 64 bit. my question is: generally, how can i make full use of my 24G memory for jboss 4.0 server. now, there's always around 16G is free. on the other hand, system is very slow. I can tune the jboss server to improve the performance to some extend. but i am wondering if there are some system level approach to do it.
tiantian
A: 

All 32-bit processes are limited to 4 gigabytes of addressable memory. 2^32 == 4 gibi.

If you can run jboss as a 64-bit process (usually just adding "-d64" to JAVA_OPTS), then you can tune jboss with increased thread and object pools to make use of that memory. As others have mentioned, you might have horrific garbage collection pauses, but you may be able to figure out how to avoid those with some load testing and the right choice of garbage collection algorithms.

If you have to run as a 32-bit process, then yes, you can at least run multiple instances of jboss on the same server. In your case, there's three options: zones, virtual interfaces, and port binding.

  • Solaris Zones

Since you're running solaris, it's relatively easy to create virtual servers ("non-global zones") and install jboss in each one just like you would the real server.

  • Multi-homing

Configure an extra IP address for each jboss instance you want to run (usually by adding virtual interfaces, but you could also install extra NICs) and bind each instance of jboss to its own IP address with the "-b" startup option.

This is the most complicated / brittle option, but at least it requires no OS changes.

Whether or not to actually configure the jboss instances as a cluster depends on your application. One benefit is the ability to use http session failover. One downside is cluster merge issues if your application is unstable or tends to become unresponsive for periods of time.

You mention your application is slow; before you go too far down any of these paths, try to understand where your bottlenecks are. Use jvisualvm or jstat to observe if you're doing frequent garbage collections. If you're not, then adding heap memory or extra jboss instances may not resolve your performance woes.

pra
very helpful. we are using the IPMP by 2 NIC.but we have not run the 2 instance as you suggested. "solaris zone" only available to solaris 10. unfortunately, we use solaris 5.10.by the way, i don't think 32bit can use 4G memory. it only apples toregular process other than jvm.
tiantian
"SunOS 5.10" is how uname reports Solaris 10; you may want to re-visit using zones. And the 4 gig limit is to total memory; your "-Xm" setings are setting the jvm heap size, which is just part of total memory.
pra