You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I reduced the default stack size from 8 MB to 8 KB. Surprisingly RAM usage remained the same in our test program which launches thousands of coroutines. Also they take a lot more time.
Is there a certain minimum it can't be lower than?
Go uses 2-4 KB, I thought it'd be possible with photon as well.
Thanks.
The text was updated successfully, but these errors were encountered:
All modern OS kernels will delay the real allocation of the physical memory pages until they are actually accessed. So the memory will not add 8MB immediately after every malloc.
The stack size is able to be set, parameters when creating threads. like photon::threada_create(entry, arg, STACK_SIZE), that feature has already provided.
Still, it can hardly be to smaller.
In 0.8 version, thread handle struct and mprotect page are located inside allocated stack space, those stuff asked at least two PAGE_SIZE as kernel provides (Yeah we have meet kernels provides 16KB pages in production environment). That means you might set at least three pages for stack.
Hi,
I reduced the default stack size from 8 MB to 8 KB. Surprisingly RAM usage remained the same in our test program which launches thousands of coroutines. Also they take a lot more time.
Is there a certain minimum it can't be lower than?
Go uses 2-4 KB, I thought it'd be possible with photon as well.
Thanks.
The text was updated successfully, but these errors were encountered: