Java.lang.outofmemoryerror:java heap space
Heap space is full:
Phenomenon:
There was a clear error, java.lang.outofmemoryerror:java heap space.
Resolve:
1. First check the parameters, vi / tomcat/bin/catalina.sh, to see if-Xms,-Xmx,-Xmn are set too small.
-Xms and-Xmx: heap size. The maximum and minimum values of the online heap must be the same. It is recommended that the maximum value of the heap be set to 80% of the maximum available memory.
Use the command free or cat / proc/meminfo to view the actual available memory = free+buffer+cache
-Xmn: sets the size of the younger generation in the heap memory, and the rest is the size of the older generation
This value has a great impact on the performance of the system. Sun officially recommends that the configuration be configured as 3x8 of the entire heap.
2. Other parameters of GC, CMS, etc.
3. Consider memory leaks.
Troubleshooting code