Attached program causes java to exit with exit code 1 after 15-25 iterations without any messages on linux.
The program does eatMemory() in a loop. eatMemory() tries to fill available memory by allocating chunks of memory till it encounters OOM, then chunk size is halved and is repeated till chunk size is small, then references are released.
I cannot reproduce this on Solaris sparc or x86. The problem only exists with -XX:+UseParallelGC. Options -XX:-UseGCTimeLimit or -XX:ParallelGCThreads seem to have no effect. There is no problem with 1.5.
Steps to reproduce:
javac MemoryEater.java
$JAVA_HOME/bin/java -client -XX:+UseParallelGC -Xmx128M MemoryEater 5; echo $?