Java out of memory on HP-UX

java.lang.OutOfMemoryError: Map failed

This is a common error for 32 bit applications. Without special handling, the largest amount of local memory (often heap area) for a 32bit program is 950 MB or one quadrant in the 4 quadrant model for 32bit programs. HP added a compiler option for programs called EXEC_MAGIC which allows the heap area to span two quadrants (each quadrant is 1GB) for a total of 1.75 GB of memory. And by modifying the EXEC_MAGIC executable with chatr, the 3rd and 4th quadrants can also be used (with some restrictions).

Starting at 11.23 (not available for 11.11), a new memory model for 32bit programs was developed that essentially eliminated the quadrant restrictions, thus allowing 32bit programs to use most of the 4GB area (32bit programs cannot use addresses beyond 4GB).

Java designers recognized this limitation some time ago and created the basic java program as an EXEC_MAGIC executable. By specifying a larger -Xms and -Xmx option on the java command line, the correct executable will be run (java_q3p or java_4p).

All of this complexity disappears when running java as a 64bit program (4TB is the new limit) but all of the programs that work with java may need to be recompiled to 64bit for compatibility.

Here is a document describing Java memory on HP-UX:
http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/c02645664…

– See more at: http://serviceitdirect.com/blog/java-out-memory-hp-ux#sthash.k6FoSFX8.dpuf


Tags: