misc/104859: rpc.statd immediately allocates 256 million bytes of memory upon invocation

Kevin Curtis, Jr. kevin at unixsite.net
Tue Nov 7 13:02:18 UTC 2006


Kriston,

I noticed the same issue and did some research.  Read the following 
excerpt from 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/book.html#STATD-MEM-LEAK

10.25. Why is rpc.statd using 256 megabytes of memory?

No, there is no memory leak, and it is not using 256 Mbytes of memory. 
For convenience, rpc.statd maps an obscene amount of memory into its 
address space. There is nothing terribly wrong with this from a 
technical standpoint; it just throws off things like top(1) and ps(1).

rpc.statd(8) maps its status file (resident on /var) into its address 
space; to save worrying about remapping it later when it needs to grow, 
it maps it with a generous size. This is very evident from the source 
code, where one can see that the length argument to mmap(2) is 
0x10000000, or one sixteenth of the address space on an IA32, or exactly 
256MB.

Sincerely,
Kevin Curtis, Jr.


More information about the freebsd-bugs mailing list