简体   繁体   中英

how much memory is allocated to jvm process

total memory allocated to the jvm process is equal to the total heap, stack, native heap. i know there are commands for setting the minimum and maximum size limits on the heap.

how about the total memory allocated to the jvm process, is there a limit on that or would it keep on increasing as the number of threads getting created increases.

if there is no limit on the number of threads and since a new stack is created when a new thread is created, would this cause the jvm to keep on increasing its size till there is no more memory left in the RAM?

The total heap. New threads use heap memory. You'll OOME if you have too many of them. Try it?

From what I know it's so. Thread stack is allocated in JVM stack and OS specific.

You can use -Xss to control the default stack size but not its upper limit.

Interesting articles

http://www.onkarjoshi.com/blog/209/using-xss-to-adjust-java-default-thread-stack-size-to-save-memory-and-prevent-stackoverflowerror/

http://blog.codecentric.de/en/2010/01/the-java-memory-architecture-1-act/

http://book.javanb.com/java-threads-3rd/jthreads3-CHP-13-SECT-6.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM