Suggest using alternate gc implementation

Running publishLocal in the zinc project can cause gc thrashing with the
default parallelgc collector using jdk8 on my laptop. If I switch to
G1GC, it does not thrash even if I leave the heap the same size.
This commit is contained in:
Ethan Atkins 2020-09-08 11:08:19 -07:00
parent 4e3d351e71
commit f23aecfdbf
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@ class GCMonitor(logger: Logger) extends AutoCloseable {
if ((total > window.toMillis * ratio) && (lastWarned.get + window).isOverdue) {
lastWarned.set(Deadline.now)
val msg = s"${total / 1000.0} seconds of the last $window were spent in garbage " +
"collection. You may want to increase the project heap size for better performance."
"collection. You may want to increase the project heap size using `-Xmx` or try " +
"a different gc algorithm, e.g. `-XX:+UseG1GC`, for better performance."
logger.warn(msg)
}
}