tags:

views:

769

answers:

2

When I start an empty JBoss 5.1 it uses this amount of memory:

  1. in default configuration
    On Windows ~ 530Mb
    On AIX ~ 220Mb

  2. in web configuration
    On Windows ~ 320Mb
    On AIX ~ 100-130Mb

Why is there so big a difference between memory usage on AIX and on Windows?
Versions of JBoss are the same.
Java 1.5.

+2  A: 

The most obvious possibility is that the different startup scripts allocate different amounts of memory. Check for the -Xms option in the scripts.

Also, different JVMs have different default memory configurations, the AIX one may have a much lower default than the windows one.

skaffman
Memory settings are the same: run.conf: JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" run.conf.bat:set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"
Vladimir Bezugliy
+2  A: 

Maybe it's just because run.bat and run.sh have been written by different people. These settings are just initial settings anyway, no one can predict what users will be doing and what settings they'll need. Just forget the difference, tune it accordingly to your needs.

EDIT: As per comment, the JVM settings are the same under Windows and AIX. However the ms and mx parameters don't have the same value so the heap size will grow with time if required and it's pretty impossible to predict how and when (this depends on the usage). I'd use same values for ms and mx to avoid that.

That said, the operating system monitoring tool (Windows perfmon or task manager or ps/top on Unix) reports the memory size of the JVM process (i.e. java.exe on windows and java on Unix).

The process memory [...] includes the object heap plus extra memory space due to the process executable, the thread runtime stack space, the thread object heap space, any space taken by the JNI and objects created from JNI, and also any other JVM spaces like PERM space which is where classes are loaded in most JVMs. [...] Use the OS monitor to watch the process size, and make sure it fits comfortably into RAM.

But, actually, due to the way each OS manages memory, I'm not sure ps and the task manager will report the same thing.

Some references:

EDIT2: Checking that your JVM process fits comfortably into RAM is one thing. But checking that your JVM is well tuned (e.g. non too long major GC) is really another thing. You won't measure the second thing with ps or the task manager, you need to profile your heap for that.

Pascal Thivent
@Pascal Thivent Memory settings are the same: run.conf: JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" run.conf.bat:set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"
Vladimir Bezugliy
Well, `ms` and `mx` don't have the same value so it's pretty unpredictable to say how the heap will grow. May I ask you a question: what is your concern?
Pascal Thivent
On testing PC JBoss+our application uses too much memory.If I deploy our application - it uses about 1GB.500Mb=JBoss + 500Mb=OurApplicationAnd I try to understand if it is possible to decrease amount of memory used by JBoss.On testing PC we have JAVA_OPTS=="-Xms256m -Xmx1024m"
Vladimir Bezugliy