Jeremy White wrote:
> I am running in to some strange memory errors when trying to optimize a
> JVM. When I set the min and max to 1.5gb and start the JVM, I
> immediately get an OutOfMemoryError. If I pull it back to 1.2gb or so,
> it works fine. The amount of physical memory in this machine is 4gb, and
> nothing else is really running on it. The machine is running RHEL 2.1,
> kernel 2.4.9-e.65smp.
> 
> We have another server that we just upgraded the OS on, to RHEL 3,
> kernel 2.4.21-40.ELsmp. On that server, the JVM starts fine with a 1.5gb
> min/max.
> 
> I suspect this has to do with the way the kernel manages memory. I know
> I have read that you can not give a JVM over 2gb of memory in Linux, [...]

This such an *old* kernel that you are almost certainly stuck
in the old 1 GB / 2 GB / 1 GB split era.

Allow me to highly recommend a more recent version (in this case
RedHat). [1]

These sorts of performance questions are often discussed in the
Java Performance Forum. [2]

Also please see the notes on Large Pages for the Sun JVM [3].

HTH,

--Tom

[1] https://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/release-notes/as-x86/

kernel

This section contains notes relating to the Red Hat Enterprise Linux 4 kernel.

    * Red Hat Enterprise Linux 4 includes a kernel known as the hugemem kernel. This kernel supports a 4GB per-process user space (versus 3GB for the other kernels), and a 4GB direct kernel space. Using this kernel allows Red Hat Enterprise Linux to run
on systems with up to 64GB of main memory. The hugemem kernel is required in order to use all the memory in system configurations containing more than 16GB of memory. The hugemem kernel can also benefit configurations running with less memory (if running
an application that could benefit from the larger per-process user space, for example.)
      Note
      To provide a 4GB address space for both kernel and user space, the kernel must maintain two separate virtual memory address mappings. This introduces overhead when transferring from user to kernel space; for example, in the case of system calls and
interrupts. The impact of this overhead on overall performance is highly application dependent.

[2] http://forums.java.net/jive/forum.jspa?forumID=60&start=0

[3] http://java.sun.com/docs/hotspot/VMOptions.html#largepages