1. java.lang.OutOfMemoryError: Java heap space JVM Heap overflow
Explanation: JVM will automatically set the value of JVM Heap when starting, JVM The heap setting refers to the setting of the memory space that the JVM can use during the running of the java program. The initial space defaults to 1/64 of physical memory, and the maximum space cannot exceed physical memory. The JVM provides options such as -Xmn -Xms -Xmx for setting. Error scenario: In the JVM, if 98% of the time is for GC and the available Heap size is less than 2%, the JVM Heap overflow resolution will occur: modify the size of the JVM Heap. 2. java.lang.OutOfMemoryError: PermGen space ie PermGen space overflow
Explanation: PermGen space refers to the permanent storage area of memory. This area mainly stores Class and Meta information, and Class will be put into PermGen space when it is loaded.
Error scenario: If the app loads a lot of CLASS, PermGen space overflow may occur. (Because sun's GC does not clean up PermGen space while the program is running) Commonly when the web server precompiles the JSP Solution: Modify the MaxPermSize size
3. java.lang.StackOverflowError stack overflow
Explanation: The JVM uses a stack of virtual machines, and the calling process of functions is reflected on the stack and the unstack. Error scenario: Usually the size of the stack is 1-2MB. If the constructor's "layer" is too much, there will be a stack overflow solution: modify the program 2. Tomcat's JVM memory overflow solution is in the production environment. Tomcat memory settings are not easy to appear JVM memory overflow, the solution is to modify the catalina.sh file in Tomcat.
In the catalina.sh file, find cygwin=false, add the parameters in front of this line, as follows
# vi TOMCAT_HOME/bin/catalina.shJAVA_OPTS="-server -Xms800m -Xmx800m -XX:PermSize =256m -XX:MaxPermSize=512m -XX:MaxNewSize=512m"Other notes: 1.<quo;m” indicates that the unit is MB, otherwise the default is KB2. Generally use 80% of physical memory as the heap size 3. Generally put -Xms It is set to be as large as -Xmx. 4. Generally set -Xmn to 1/45 of -Xmx value. Generally, allocate 50% to 60% of the total size of the heap to the newly generated pool. 3. jvm Parameter Description: -server To be the first parameter, enable the JDK server version, which performs well on multiple CPUs - the initial size of the Xms java Heap. The default is 1/64 of physical memory. -Xmx java heap maximum. The recommendations are set to 80% of physical memory. Do not exceed physical memory. -Xmn java heap minimum, generally set to 3 or 4 of Xmx. -XX:PermSize Sets the initial size of the permanent storage area of the memory. The default value is 64M. -XX:MaxPermSize Sets the maximum size of the permanent save area of the memory. The default value is 64M. -XX:SurvivorRatio=2 The size of the survivor pool. The default is 2. For example, -XX:NewSize the initial size of the newly generated pool. The default is 2M. -XX:MaxNewSize The maximum size of the newly generated pool. The default is 32M. +XX: AggressiveHeap Let jvm ignore the Xmx parameter, frantically eat a G physical memory, and then eat a G swap. -Xss Stack size per thread - verbose:gc Real garbage collection information - Xloggc:gc.log Specify garbage collection log file -XX:+UseParNewGC Reduce minor collection time -XX:+UseConcMarkSweepGC Reduce major collection time -XX: userParNewGC can be used to set parallel collection (multiple CPU) - XX: ParallelGCThreads can be used to increase parallelism (multiple CPU) - XX: UseParallelGC can be set to use parallel cleanup collector (multiple CPU)
How Linux extends the XFS file system. There is extra space on the disk, so I want to extend the exi
linux system - file sharing a file sharing premise 1 windows and linux ping pass test methods as fol
Many users who are new to Linux will use the concept of Windows to understand Linux system.
Liunx shared file server uses samba, so the linux shared server is to set up the samba server; 1, n
How to make software packages under Linux system
Linux pipeline and redirection
Linux view and terminate process
Nginx sets the directory protection, anti-theft chain, speed limit, multi-domain method
Linux system unzip decompression Chinese name garbled solution
Real-time automatic backup of switch configuration files every day with Linux server
Add and remove environment variables PATH path in Linux system
Get CPU information under Linux
Windows Vista SP1 v658 installation completed difference
Win7 system boot prompt dll file error how to solve
A few steps will make your Win7 login interface easy to replace
Windows 8 market share increased to fifth place
How to clear Windows 7 search history
Does the Windows 7 system consume a lot of power?
Windows 7 method of creating a virtual disk partition
How to restore XP "show desktop" button
WinXP how to change the shutdown interface back to the classic mode
What should I do if the fast broadcast software is always automatically upgraded?