Re: VM overhead

From: Rik van Riel (riel@conectiva.com.br)
Date: Thu May 18 2000 - 08:46:38 EST


On Thu, 18 May 2000, Erik Corry wrote:

> If I mmap 1 Gbyte of VM (anonymously, privately from /dev/zero) but
> don't use much of it, how much RAM does the system spend managing
> it? Is there a fixed per-page (4k) overhead for the PTEs?

One page (4 kB) per 4 MB of memory, so 1 MB overhead for
your 1 GB mapping.

> Also, why does top misreport the RSS as 1Gbyte in this case
> (kernel 2.2.5-22, procps-2.0.2-2)? Kernel bug?

The pages you have not written to all point to the
zero-filled page. If you set up the mapping you'll
have 256k mappings to that one page :)

> Do I need more real RAM to fork if I have a large mmap like this?

No. You will only need more RAM (or swap) if you
write to a lot of the pages, otherwise they'll
keep pointing (COW) to the zero-filled page.

regards,

Rik

--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies http://www.conectiva.com/ http://www.surriel.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:15 EST