Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e02cb43

Browse files
authoredJan 28, 2018
Adding note on -XX:+DisableExplicitGC
1 parent 74ccaf3 commit e02cb43

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎part_5/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ something is forcing a GC cycle to occur, rather than letting the JVM trigger th
166166
2015-09-30T12:23:44.430+0600: 195.704: [Full GC (System.gc()) [PSYoungGen: 3562K->0K(76288K)] [ParOldGen: 10469K->9174K(114176K)] 14032K->9174K(190464K), [Metaspace: 25137K->25137K(1071104K)], 0.0724521 secs] [Times: user=0.38 sys=0.01, real=0.07 secs]
167167
```
168168

169+
It is generally recommended to use the `-XX:+DisableExplicitGC` JVM option to disable forceful GC events. This will allow
170+
the JVM to still have garbage collections, but it disables them from being triggered explicitly. The description of this option:
171+
172+
> By default calls to System.gc() are enabled (-XX:-DisableExplicitGC). Use -XX:+DisableExplicitGC to disable calls to System.gc(). Note that the JVM still performs garbage collection when necessary.
173+
169174
### Enabling GC logging
170175

171176
With our service, let's go ahead and start it up with GC logging enabled:

0 commit comments

Comments
 (0)
Please sign in to comment.