JAVA Memory overflow solution
Posted: Mon Jan 14, 2019 2:20 am
1、Question:
Log in Java. Lang. OutOfMemoryError: Java heap space.
2、Problem analysis
Java. Lang. OutOfMemoryError: Java heap spaceHeap set the JVM heap size setting refers to the Java program is running process used to reach the JVM can allocate memory Settings. The JVM heap size is automatically assigned at start-up time value, its initial space (Xms) is 1/64 of the physical memory, the largest space (-xmx) is a quarter of physical memory. You can set it using the -xmn-xms-xmx and other options provided by the JVM. Heap size is the sum of Young Generation and Tenured Generaion. Tip: in the JVM this exception is thrown if 98% of the time is spent in GC and the Heap size available is less than 2%. Tip: the Heap Size should not exceed 80% of the available physical memory. In general, set the -xms and -xmx options to the same value, while the -xmn is 1/4 of the -xmx value. JAVA_OPTS = "- server - Xms128M - Xmx256Mjava. Lang. OutOfMemoryError: The full name of PermGen space is Permanent Generation space, which refers to the Permanent storage area of memory. This memory is mainly used to store Class and Meta information by JVM, and the Class will be put into PermGen space when it is loaded. Unlike the Instance Heap area,GC(Garbage Collection) does not clean PermGen space at runtime, so if you have a lot of classes in your application, you are more likely to get PermGen space errors, which are common when web servers precompile JSPS. This error message is generated if your WEB APP USES a large number of third-party jars that are larger than the JVM's default size (4M). JAVA_OPTS = "- server - XX: PermSize = 64 m - XX: MaxPermSize = 128 m
Log in Java. Lang. OutOfMemoryError: Java heap space.
2、Problem analysis
Java. Lang. OutOfMemoryError: Java heap spaceHeap set the JVM heap size setting refers to the Java program is running process used to reach the JVM can allocate memory Settings. The JVM heap size is automatically assigned at start-up time value, its initial space (Xms) is 1/64 of the physical memory, the largest space (-xmx) is a quarter of physical memory. You can set it using the -xmn-xms-xmx and other options provided by the JVM. Heap size is the sum of Young Generation and Tenured Generaion. Tip: in the JVM this exception is thrown if 98% of the time is spent in GC and the Heap size available is less than 2%. Tip: the Heap Size should not exceed 80% of the available physical memory. In general, set the -xms and -xmx options to the same value, while the -xmn is 1/4 of the -xmx value. JAVA_OPTS = "- server - Xms128M - Xmx256Mjava. Lang. OutOfMemoryError: The full name of PermGen space is Permanent Generation space, which refers to the Permanent storage area of memory. This memory is mainly used to store Class and Meta information by JVM, and the Class will be put into PermGen space when it is loaded. Unlike the Instance Heap area,GC(Garbage Collection) does not clean PermGen space at runtime, so if you have a lot of classes in your application, you are more likely to get PermGen space errors, which are common when web servers precompile JSPS. This error message is generated if your WEB APP USES a large number of third-party jars that are larger than the JVM's default size (4M). JAVA_OPTS = "- server - XX: PermSize = 64 m - XX: MaxPermSize = 128 m