How to calculate used shared memory in slab?

nobody junk at
Wed Aug 17 21:36:00 UTC 2016

Hello, I'm the developer of Nchan (previously known as the http push
module) -- I'm writing a stub_status -
like stats output handler, and I want to output the amount of shared
memory actually used. I could keep track of the raw bytes allocated with
wrappers to ngx_slab_alloc, but that does not produce accurate numbers
because the slab allocator works on pages.

I'm having some trouble understanding the internal working of the slab
allocator. Is there a straightforward way to get the number of pages
currently in use?


More information about the nginx mailing list