Java OutOfMemoryError commonly encountered in two categories, respectively, prompted: "Java heap space" and "PermGen space", the front refers to the Java memory is not enough, after the exception refers to the load class of memory is not enough, Corresponds to heap memory and non-heap memory (JVM's own memory). These two exceptions are resolved in different ways:
java heap space resolves: the java run parameter is: "-XMX4G" to increase the value, the default value is 1/4 of physical memory.
"PermGen space" Resolved: Execute java Run parameter add: "-xx:maxpermsize=1024m", the value is larger, the default value is 1/4 of physical memory.
--Other:-XMS (Specifies the heap size at initialization time, default physical memory of 1/64),-xx:permsize (non-heap memory size when initializing, 1/64 of default physical memory)
[Java]-Java outofmemoryerror categories