JVM Heap size as a ratio of system physical RAM (Weblogic)

1

How much should the max JVM heap size be set for a specific size of Physical RAM. e.g. With 8GB RAM, I can set the MAX heap size for a server app as 3GB.

This question is specific to Java 1.8 and a weblogic 12c server assuming that it is a headless linux server with weblogic server as the main server process running.

Is a general rule of thumb or some documentation suggesting this mapping. So for example:

8  GB RAM -- Max JVM Heap size XX GB
16 GB RAM -- Max JVM Heap size XY GB
32 GB RAM -- Max JVM Heap size YY GB

Mythbuster

Posted 2019-01-16T21:31:28.123

Reputation: 11

Answers

1

There is no hard and fast rule for sizing your heap - it very much depends on the workload, and what other tasks the server is doing and their requirements.

Some workloads would benefit from more free memory (so the OS can use it as filesystem cache etc), where as other workloads the JVM needs as much memory as the OS can spare (without starving it!).

Without significantly more information its not possible to advise you either way other than to suggest you do some testing. Pick an optimal configuration based on actual/expected usage and measure it against suitable performance metrics (response times, requests/sec etc) that make sense for your application.

MisterSmith

Posted 2019-01-16T21:31:28.123

Reputation: 407

Here is some oracle documentation for Java 1.6 which specifies Heap size as a fraction of RAM.

Default Heap Size ...The proportion of memory to use for the heap is controlled by the command line options DefaultInitialRAMFraction and DefaultMaxRAMFraction, as shown in the table below. .. maximum heap size MIN(memory / DefaultMaxRAMFraction, 1GB) MIN(memory / 4, 1GB)

[link]https://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom

I am looking for a similar reference / guidance for maximum and minimum Heap for Java 1.8

– Mythbuster – 2019-01-18T20:16:37.870