With the -Xms and -Xmx you can set the initial and maximum size of the memory allocation pool. Using strace / truss on Linux and AIX, I found that the JVM internally uses the (k) mmap system call. The parameter address is NULL, so the operating system decides on which virtual memory address it maps the memory.
$ truss java -Xmx512M Hello 2>&1 | grep mmap kmmap(0x00000000, 536870912, 3, 17, -1, 0x00000000, 0x00000000) = 0xB0000000
Can this address be specified?
Reference Information. I need to call outdated code through the Java Native Interface (JNI), which requires a huge amount of non-moving data (2 GB in 32-bit address space) displayed in a specific place in memory. This area overlaps with the location of the Javas memory allocation pool.
Edit: this is the actual memory layout:
0x0... AIX 0x1... Text 0x2... Stack 0x3... Heap 0x4... Heap ...... Legacy Data (2 GB) 0xd... Shared Library Text 0xe... unused 0xf... Shared Library Data
My goal is to move the Java memory allocation pool from 0xb / 0xc to the 0x3 / 0x4 segments, which is also available in the standard (not large) memory model.
Frank source share