another memory usage experiment! scripts+results: https://gist.github.com/thejh/6eddd199d71f5e5a221b827c7aa2a271 … this one is to see how many pages of present/swapped memory are completely within free malloc chunks, and wrote a script to MADV_DONTNEED that memory away (but don't run that on any machine you care about!)
-
Show this thread
-
there was a qemu-system-x86_64 process on this box that AFAICS used 42MiB worth of pages for free glibc chunks, for example. and libvirtd used 7MiB.
2 replies 0 retweets 1 likeShow this thread -
(but, uh, *really* don't run those scripts on any box that you don't want to crash. for some reason the init daemon spewed some segfaults immediately when the madvise(..., MADV_DONTNEED) was injected by gdb... not sure whether that's because of gdb or because of the madvise())
1 reply 0 retweets 1 likeShow this thread -
might be cool to teach glibc to MADV_DONTNEED free pages when a certain signal arrives, or something like that
1 reply 0 retweets 2 likesShow this thread -
Replying to @tehjh
you can do simpler than that ;-) all you need to call is malloc_trim(0) at key points, and this happens safely (properly locked etc) for example, right before going to a poll() waiting for events.
2 replies 1 retweet 5 likes
oooh! interesting, it actually calls MADV_DONTNEED. I only looked at the manpage for that function before, and the manpage incorrectly claims "This function cannot release free memory located at places other than the top of the heap"
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.