VJS
VJS

Reputation: 2951

Java Heap Distribution Concept Query

I am using below GC memory parameters :

export MEM_OPTS="-Xmx2900m -Xms2900m -XX:NewSize=786m -XX:MaxNewSize=786m -XX:+UseTLAB -XX:MaxPermSize=128m"

I am using 32 bit JVM.My server RAM is 10 GB.

From Oracle site, I got

Why can't I get a larger heap with the 32-bit JVM?

The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G. On 32-bit Solaris kernels the address space is limited to 2G. On 64-bit operating systems running the 32-bit VM, the max heap size can be higher, approaching 4G on many Solaris systems. As of Java SE 6, the Windows /3GB boot.ini feature is not supported. If your application requires a very large heap you should use a 64-bit VM on a version of the operating system that supports 64-bit applications. See Java SE Supported System Configurations for details.

Ok.Now lets assume my 32 bit server can take 3.2 GB.As i know :

-Xmx is the total heap memory
-XX:NewSize / -XX:MaxNewSize is the range of the size of the new generation inside that heap
the difference is the range of the size of the old generation
-XX:PermSize / -XX:MaxPermSize is the range of the size of the permanent generation, which is the non-heap memory

According to this, 3.2 GB should not include PermSize as this is a not a heap content.Right ?

Let me know if am wrong.

I can divide 3.2 GB in Xmx and NewSize . Right ?

Upvotes: 0

Views: 475

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533510

The NewSize is a portion of the maximum heap size. It must be smaller.

I would use the 64-bit JVM if you have Java 6 as it will make your life simpler. ;) Unless you have to use 32-bit share libraries, there is little down side.

BTW -XX:+UseTLAB is the default.

Upvotes: 1

Related Questions