Are some allocators lazy?

On Linux, malloc requests memory with sbrk() or mmap() – either way, your address space is expanded immediately, but Linux does not assign actual pages of physical memory until the first write to the page in question. You can see the address space expansion in the VIRT column, while the actual, physical memory usage in RES.

Leave a Comment