Hacker News new | past | comments | ask | show | jobs | submit login

This is so wrong:

>With 1 core it is always serialgc

Even with 1 CPU ParallelGC has lower latencies than SerialGC on 1 CPU. SerialGC will be better on environment with limitations on number of threads, not number of CPUs.

> 2 cores and less than 4 gb - concurrent mark and sweep IIRC

CMS has been deprecated in 11 and removed later in a non-LTS release. JVM ergonomic will automatically turn on >G1GC< when it detects JVM has at least 2 CPUs and 1792Mb of RAM (not heap, memory in total). When either or both numbers are lower then ParallelGC is enabled automatically.




The serial and parallel GCs are best used for applications that care more about throughput than latency (pauses). If you only have one CPU core, running multiple threads isn't going to speed up the GC cycle. The parallel collector just adds overhead due to context switching among threads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: