[External] : Re: Project Loom technical questions

Ignaz Birnstingl ignazb at gmail.com
Sun Aug 1 21:19:12 UTC 2021


>> Relying on virtual memory alone is insufficient. Once the memory is  
>> committed, it won’t be uncommitted,
>> so usage grows, but doesn’t shrink, and all that’s done at page  
>> granularity. Once you add guard pages
>> to prevent stack overflows, you’ll get close to 10GB of *committed*  
>> memory for 1M threads, and that’s
>> before they do anything, and the memory would only grow monotonously  
>> from there.
I think if you use guard pages then you can also use them to shrink the  
stacks again.

Page granularity is certainly an argument (and that is why I wrote virtual  
and kernel stacks are "roughly" of same size ;)) and it clearly depends on  
average stack sizes how big the page granularity offcuts are in relation  
to the stack size. In my experience stacks can grow quite large (> 300KB)  
- especially during classloading - but I'm sure you guys know more about  
the *average* stack sizes and those tend to be smaller.

Anyways I now have a much clearer picture of the resource consumption of  
virtual threads and the trade-offs you guys considered. Many thanks for  
your replies and I'm looking forward to trying Loom!

-- 
Ignaz


More information about the loom-dev mailing list