out of curiosity, has anyone seen a discussion abo...
# random
g
out of curiosity, has anyone seen a discussion about why the JVM needs to keep all `Thread`'s stack memory size the same? I feel like an awful lot of performance problems could be solved if the JVM was allowed to operate with differently-sized thread stacks. For threads that simply call blocking API's and dump the result into a
Channel
(or other coroutine/threading device), I would really appreciate the ability to tell the JVM that this thing just needs maybe 8Kb of stack.
m
Have you tried with
-Xss
?
g
right but thats globally isn't it? What I'd like is to say that one thread pool's threads are the default and another thread pools threads have very small stacks
e
They should just follow Go’s example and allocate stack in 4k “stacklets”. It is a good compromise between performance you loose when you have to call external C libs (you’ll have to swtich to a real big stack) and per-thread overhead