On Fri, Mar 12, 2021 at 03:43:33PM +0100, Peter Weber wrote: > Hello! > Hopefully I'm asking here in the right place and don't disturb. > > Is anonymous memory - i.e. program heap and stack - part of the page cache > on Linux? The documentation[1] of the kernel does not state that. But the > Wikipedia entry about page cache contains a graphic[2] (look at the top > right) which gives me the impression that 'malloc()' allocates dynamic > memory within the page cache. The wikipedia diagram is wrong. Anonymous memory is not handled by the page cache. Anonymous pages enter the storage stack via swap; they are found in the page tables, sent to the swap cache and then written to swap devices or swap files. Filesystems may get involved at that point, but not always. There are other weird things in the wikipedia diagram, like Direct I/O being seemingly detached from applications, and not appearing to pass through the VFS.