The memory pool not found exception is an mbean exception. Therefore, mbean must be used for this exception.
It is suspected that the JVM has not been initialized, mbean in the agent has started to get the status, or before the JVM is about to crash, mbean cannot get the correct status, but none of these situations are found.
Later, the Taobao-JDK team analyzed the cause in useadaptivesizepolicy.
Possible cause:
When using CMSAlgorithmIf useadaptivesizepolicy is enabled, the size of Eden, from, and to will be re-calculated after each minor GC operation. The calculation process is based on the statistics of the GC process, after calculation, the Eden + from + to will not exceed xmx, And the from and to are generally not equal (the from and to are equal during initialization ). The main problem is that after calculation, if the Eden becomes larger, the max_eden_size in the contiguousspacepool is not updated or the value at the beginning. This causes the JVM to call Java through call_special. lang. management. the memoryusage constructor generates an exception because Eden committed is larger than max_size of Eden, leading to the return of Java. lang. management. the memoryusage object fails, leading to display exceptions.
Sun's JDK has not modified this bug so far.
Solution: You can set-XX:-useadaptivesizepolicy to workaround first.