简体   繁体   中英

How much memory should be set to JVM

How much memory should be configured to use if I want to utilize all server ram.

For example, if servers has 32Gb ram, which settings should be set via Xmx? 32Gb-10%? or 30Gb-4Gb? Any other heuristic?

First step is to understand how much of your memory is really free.

1) How much does your OS take? (consider also some space for OS caches)

2) Are there any other apps running which might use significant amount of memory? (DB, etc.) How much do they usually take?

3) What kind of IO does your app do? Hard drive? Network? Both will benefit from some free memory.

If I were you I would start around (if there aren't any other apps) 24 GB. Then run some stress test and monitor memory utilization and fix your setting based on this observation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM