Disable explicit GC by default

We don't rely upon GC to cleanup mappedbytebuffers, we unmap them
explicitly on close in lucene. But the JDK has crazy loops with
explicit GCs in exceptional cases to try to force unmapping.

In general we don't want any of our code or library code calling
this method: so its banned in forbidden-apis as well.
This commit is contained in:
Robert Muir 2014-06-27 13:02:26 +02:00
parent b2685f132a
commit a3d5381392
4 changed files with 6 additions and 0 deletions

Binary file not shown.

View File

@ -62,3 +62,6 @@ JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
# The path to the heap dump location, note directory must exists and have enough
# space for a full heap dump.
#JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof"
# Disables explicit GC
JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC"

Binary file not shown.

View File

@ -51,5 +51,8 @@ java.lang.Object#notifyAll()
java.lang.Math#abs(int)
java.lang.Math#abs(long)
@defaultMessage Please do not try to stop the world
java.lang.System#gc()
@defaultMessage Use Long.compare instead we are on Java7
com.google.common.primitives.Longs#compare(long,long)