Hi. I run a Java program that needs tens of GB of memory. The computer has 64GB of memory. I run java with -Xmx48GB.
The process runs as follows (a screenshot from jvisualvm: http://s13.postimage.org/g8alcbcnr/heap.png)
Note: is is a 24-core system, so a single thread has at most about 4% cpu.
1. About a dozen GCs occurs, where heap used (as reported by jvisualvm) increases slowly to 6GB. Total heap size (again, reported by jvisualvm) is 16GB.
2. About five minutes of a slown down to almost halt (usable threads). Linux' "top" reports 100% CPU however. Jvisualvm shows about 0% CPU, 0% GC.
3. Again, the app runs, about 20 GCs occurs, where heap used slowly increases to 12GB. Total heap size is 28GB.
4. The app almost halts again like in (2), this time however it is so until at least half an hour, possibly longer, as I terminated the process.
Heap used is almost constantly 12 GB, very, very slowly rising. Total heap size is 28GB, most of it seemingly unused. Free system memory, as reported by
"top", is still >10GB. "Top" shows 100% cpu usage, jvisualvm disagrees, showing some "sawtooth" wave this time
So, it seems that despite -Xmx48GB and still free system memory, usable heap space is at most about 12GB. Why? Can it be a problem with the app?
(it is a single threaded pure numerical application, jvisualvm's CPU monitor seems to convey, that the app runs as usual, albeit very slowly). Or is it related
to some JVM problem? "Top" shows, that the process is doing something, while it is not. Can it be, memory access gets very slow around 12GB?
I do not know if it is the sole case, but I have found at least one reason: jvisualvm's memory sampler, when its table is visible, almost freezed the sampled app. Perhaps it is due to the large number of instances.