Date: Wed, 07 Jun 1995 01:50:08 -0700 From: David Greenman <davidg@root.com> To: Ken Wilcox <wilcox@math.psu.edu> Cc: Temptation <temp@temptation.interlog.com>, freebsd-hackers@freebsd.org, dyson@root.com Subject: Re: Top Message-ID: <199506070850.BAA00192@corbin.Root.COM> In-Reply-To: Your message of "Wed, 07 Jun 95 00:48:44 PDT." <199506070748.DAA00612@napier.math.psu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
>If I read this correctly, you are saying you have 256 Megs of physical memory >and 25 Megs of swap? Unless I am mistaken, this is your problem. FreeBSD does >demand paging, which means that when a program is run it is first loaded into >pagespace and then when it goes to start the first instruction of the >executable, it performs a page fault and loads the first page and continues on >from there. Some OS's do this in a different way where they mmap the >executable on the disk and page off of that, which is what I believe SunOS >does. Now this could all be wrong, but what I am about to say might not be. FreeBSD pages from the on-disk file for the program text. Copy on write data and demand zero bss are paged from swap if sufficient RAM doesn't exist. The total amount of available virtual memory is RAM+swap. The system should work without any swap space if you have enough memory. Based on the information provided, it looks as though his system is exceeding RAM+swap, and I don't know what the cause of this is (I think he said something about 500 ptys, so perhaps this isn't too surprising. :-)). pstat -s on his system shows that there is no swap space available (all 25MB in use). However, I think there is an algorithmic bug in the out of swap space condition. The system should free up "cached" pages when swap space gets short. Currently, the pagedaemon will periodically wake up and (in John's words) "churn" memory a little to page out pages that are seldom referenced in favor of caching file data. This can be a problem in a memory over-commit situation, however, as it can lead to an out-of-swap condition when the file cache growth causes enough pages to be paged out that it exceeds the available swap space. It appears that this would result in vm_fault needlessly killing off processes. We'll have to fix this. >As I explained this above, everything that you run must first find it some swap >space, meaning, you can only use as much memory as you have swap. That is why >it is a general rule, at least with what I have heard, that you have 2 1/2 >times as much swap as you have memory. Now, in your case that would explain >why you have used 100% of your swap space and only 25 Megs of ram. Now, just >add 256 Megs of swap and you'll be set. You could always give me some of that >mem :) This is not correct. -DG
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506070850.BAA00192>