Please implement client switch in 64-bit server JDK 14 builds

Andrew Haley aph at redhat.com
Wed Aug 7 08:49:24 UTC 2019


On 7/19/19 3:46 AM, Ty Young wrote:

> A "client" JVM variant is geared towards graphical end-user
> applications. According to a URL link found in the man entry for
> java[1] this supposedly results in faster startups. While this *may*
> be true, a much larger and more important benefit is a massive
> committed memory reduction in the range of about 25% to 50% when
> running a JavaFX application. At minimum with similar heap sizes,
> that is a 75 MB memory savings at 300MB (a somewhat typical peak
> usage with JavaFX applications) with a typical server JVM. That's
> huge.

The problem is to some extent that Java sizes itself based on the
machine that it is running on. If it sees plenty of memory and threads
it uses them, in an attempt to improve performance.

I think you should be able to achieve some similar results to -client
by trying -XX:TieredStopAtLevel=1 and sizing the heap appropriately
for your application. There is also a bunch of GC settings which cause
it to be very frugal with memory. These together will, I suspect, be
more effective than the old "-client" option.

In general, I think we do need a "-small" option for the JVM. The GC
defaults are inappropriate for a lot of applications. However, I'm not
exactly sure what "-small" should be.

One set of options we use is:

USE_JVM_ARGS="-XX:+UseParallelGC -XX:MinHeapFreeRatio=5 \
   -XX:MaxHeapFreeRatio=10 -XX:GCTimeRatio=4 \
   -XX:AdaptiveSizePolicyWeight=90 -Xms20M -Xmx500M \
   -XX:MaxMetaspaceSize=100m -XX:+UnlockExperimentalVMOptions \
   -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true"

Please let us know if this helps in your case.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the jdk-dev mailing list