0

I'm running 2 jboss5.1 server, on linux & solaris machines, with similar jvm (xms & xmx) configurations. But when i check the memory usage on server start:

  • linux machine -- 2.1gb mem usage (RES)

  • Solaris machine -- 500mb mem usage

Memory used by jboss process on linux is above 1 gb from the start (even before any class loading starts). When i take dump from linux its size is around 700 mb only.

What could be causing such a difference of memory?

DreadPirateShawn
  • 8,164
  • 4
  • 49
  • 71
Abhishek Agarwal
  • 846
  • 4
  • 13
  • 34
  • What JVM are you using (version, editor) ? What options are used, all of them ? Are native libraries involved ? What commands are you using to measure the memory usage ? What says `pmap -x java_pid` on both OSes ? – jlliagre Oct 23 '13 at 09:18

1 Answers1

0

A lot of things could make the difference, and there is not enough information here to know what. For example, are they both 64-bit OS's and 64-bit JVMs? What about the behavior of malloc - that's up to the OS. Just because a process asks for N bytes of memory doesn't mean it immediately gets that much memory - memory allocators can be very clever. Then there is the question of whether it's actually an apples-to-apples measurement in terms of how the OS reports it.

"Memory usage" means a lot of things. Are we talking about the Java heap (if you take heap dumps of both VMs after startup and an identical priming bit of work, are they the same size or different?), or that plus class data, etc.? You also have hotspot in the picture, compiling Java bytecode into native code that will be different between the two OS's (maybe very different sizes if your Solaris box is a Sparc machine)

The most likely thing is 64-bit vs. 32-bit, but it's impossible to say. You might use some native profiling tools on each to see what calls are allocating memory - that would start to clarify things.

Unless it's causing a problem, it's probably not something to worry about - but healthy curiosity is a good thing.

Tim Boudreau
  • 1,741
  • 11
  • 13
  • tried using both 32 & 64-bit but the result is same. JProfiler and dumps (Memory Analyzer) are not showing any discrepancies between the two. Problem is linux machine application going OutOfMemory even though we can see memory usage is high but still less then our max heap size i.e. 3GB. – Abhishek Agarwal Oct 23 '13 at 06:34