I am observing the connection of mongoDB. when a new connction generated, I can see a new thread created ( pstack ·pgrep monnod| grep -c Thread), and some new chunks memory allocated (get from /proc/pgrep mongod`/maps), one of the chunk is 1024K, which should be the stack size for the new thread, I saw it was set to 1024k in the code.
when I exited this session, the No. of threads decrease by 1, but the memory still there. when I generate a new connection, these memory seems reused. so I guess it should be the behavior of linux Kernel.
Can I konw if I am right? and where is this feature well documented?
thanks for your help!
I am observing the connection of mongoDB. when a new connction generated, I can
Share
This has nothing to do with the kernel.
GLIBC will
mmapthread stack, and has a cache of such stacks. The code is here.