I have 64GB of RAM on my centos 7 server. One of my application has 4096mb of JVM heap size but keep getting java.lang.OutOfMemoryError: GC overhead limit exceeded
exceptions frequently. What is the relationship between RAM and JVM heap size so that I can expand it accordingly.
Asked
Active
Viewed 1,472 times
0

MbaiMburu
- 875
- 1
- 10
- 19
-
How much RAM you have doesn't determine how much memory your program needs. If your program needs more memory, you have to either increase the maximum or optimise the program to use less. – Peter Lawrey Jul 26 '18 at 08:43
1 Answers
0
Issue is with the Heap Size. You can increase the heap size. Following are few options available to change Heap Size.
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
**For Example :-**
-Xms512m
-Xmx2024m
-XX:MaxPermSize=700m
-XX:ReservedCodeCacheSize=480m

Hasnain Ali Bohra
- 2,130
- 2
- 11
- 25
-
-
**java -XX:+PrintFlagsFinal -version | findstr HeapSize** run this command to find out the RAM size which used by JVM.There is no realation with garbage collector as *GC* run over the RAM to clean reference – Hasnain Ali Bohra Jul 26 '18 at 08:24
-