Comment

Comment by eqvinox

There is a very glaring omission (or call it gloss-over) in this article - whether and when a free() even causes the allocator to actually release memory to the OS. JVMs are kinda famous for their "om nom nom" attitude on this, but you can't transfer from ptmalloc (glibc, whose man page is cited regarding >=128k mmap) to tcmalloc and jemalloc.

Also, on Linux, an allocator may use madvise(MADV_FREE) instead of munmap(); this tells the kernel that the data in a page is no longer needed but can be unmapped at the kernel's discretion, possibly even at different times for different threads (e.g. when doing a task switch for an unrelated reason.)

[EDIT: this doesn't actually work, see below. Sorry.]

parent eqvinox 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton