简体   繁体   中英

What are Stack threads in Java?

I see App ENV option to configure "-stackThreads=250 " by memory calculator in java buildpack for cloud foundry applications. what are these stackThreads and what it really do. how it affects app by changing this value. some people are using the word "stack thread" and "thread stack" interchangeably. is it so or different(though i understand the definition of thread stack)

cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '{ jre: { version: 11.+ }, memory_calculator: { stack_threads: 25 } }'

-stackThreads is an argument to the Buildpack Memory Calculator, not to the JVM. It's the number of concurrent threads that will be used when estimating the memory usage due to thread stacks. A thread stack is (broadly) the amount of memory allocated to the stack in each thread, as set by the -Xss option. In general, overall memory usage will be increased if the thread stack is larger, or if more threads are running.

So far as I know, the JVM itself does not have a -stackThreads option, so setting it on the JVM when running an application will have no effect. In fact, it will likely be treated as an error in the command line. I don't think "stack thread" is even a meaningful term in Java.

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