Runtime data area | Thread-private (with the start and end users to create and destroy threads while) or shared by all threads (with the virtual machine process exists) | Exceptions thrown | Remark |
---|---|---|---|
Program Counter (Program Counter Register) | Thread-private | The only area not throw an exception of OOM | |
Virtual Machine stack (VM Stack) | Thread-private | It will throw StackOverflowError, OutOfMemoryError | |
Native method stacks (Native Method Stack) | Thread-private | It will throw StackOverflowError, OutOfMemoryError | |
Heap (Heap) | All threads share | It will throw OutOfMemoryError | And set the heap size by -Xmx -Xms |
Method region (Method Area) | All threads share | It will throw OutOfMemoryError | |
Direct memory (Direct Memory) | It will throw OutOfMemoryError |
Java virtual machine memory management, runtime data area contains
Guess you like
Origin www.cnblogs.com/cag2050/p/11894668.html
Recommended
Ranking