Re: RAM/Memory resources on 7 STABLE
David Scheidt wrote: On Sat, Jan 17, 2009 at 01:25:19AM +, RW wrote: On Fri, 16 Jan 2009 22:23:06 +0100 (CET) Wojciech Puchar woj...@wojtek.tensor.gdynia.pl wrote: When I boot this machine it usually shows (in top) about 11 G Free in the Mem: line The machine, in this snippet, has been up for 5 days 22 hours and change and it now shows 1436M free in the Mem: line I've been watching the number and it has been slowly decreasing over the 5 days since its last boot. It looks like as the Free line trends down, the Inact value trends up to keep the total Mem used at the installed 12G ALL unused memory is used as disk cache in FreeBSD. Although, looking at the output of top, most of the memory is in the inactive state. As I understand it cache pages go from active to cached, and the inactive queue contains pages that need to be written out to swap before they can be reused. No. It just means they're not active -- nothing has touched them recently. They may be dirty. They may not be. Recently means the last 20 seconds to a minute, depending. The very high level of inactive memory looks suspiciously like a memory-leak to me. Hopefully someone who knows more about this will step in - don't take my word for it. I have no data on the system in question, but it's very common for a machine to have large amounts of inactive memory, particularly one that's not under any sort of memory pressure. My basically idle workstation has 1.5 GB of memory, 5 MB free, and over a gig inactive. Since I'm not doing anything with it (I'm writing this from another machine), and its just hanging out, this is what I'd expect. Should it do something that requires memory, the pager will toss clean inactive pages to the free list, and they'll be reused. Of course, if what they're required for is something they already have in them (like the code segments of recently terminated application that's restarted), they'll get reused, saving having to read them from disk. The only time you'll large amounts of memory on the Free list is when a machine is first booted and hasn't touched that memory for anything, or when an application that's got a large dyanmically allocated block of memory terminates. The rest of the time, the free list should be small. If the machine isn't swapping, there's usually nothing to worry about. For comparison's sake here is the top -P output from my Dell 2950 dual quad core server; this one is has 8 GB or RAM installed last pid: 94403; load averages: 0.02, 0.38, 0.63 up 11+21:13:56 12:12:47 69 processes: 1 running, 68 sleeping CPU 0: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 1: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 2: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 3: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 4: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 5: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 6: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 7: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Mem: 226M Active, 2683M Inact, 465M Wired, 552K Cache, 214M Buf, 4537M Free Swap: 16G Total, 16G Free uname -a FreeBSD dl 7.1-STABLE FreeBSD 7.1-STABLE #7: Mon Jan 5 13:53:52 EST 2009 r...@dl:/usr/obj/usr/src/sys/AMD amd64 And here is the top -P from my Dell 2850 dual core server with 12 GB RAM installed: last pid: 9877; load averages: 0.07, 0.04, 0.07up 6+22:31:45 12:20:13 98 processes: 1 running, 97 sleeping CPU 0: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle CPU 1: 0.0% user, 0.0% nice, 1.5% system, 0.0% interrupt, 98.5% idle CPU 2: 0.4% user, 0.0% nice, 0.0% system, 0.0% interrupt, 99.6% idle CPU 3: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Mem: 242M Active, 10G Inact, 431M Wired, 128M Cache, 214M Buf, 943M Free Swap: 2014M Total, 2014M Free FreeBSD www 7.1-STABLE FreeBSD 7.1-STABLE #2: Tue Jan 6 19:24:57 EST 2009 r...@www:/usr/obj/usr/src/sys/DELL64 amd64 Both of these machines are running nearly identical software; the main difference is that the 2950 quad core is also running Samba. I can see the numbers move up and down between Free and Inactive on the 2950, but the 2850 just continues to have Free in decline; it now shows 10G inactive. When I stop and restart apache, MySQL and Mailman on the 2850, I can see an small increase in the Free and a decrease in inactive. As far as I know, neither machine has ever gone into swap. The 2850 has only 2 G of swap space because originally the machine only had 1 G of RAM. I don't know what the Free vs Inactive numbers were on that box back then. I just never noticed the numbers. Again, I don't know that there is any problem at all, I'm just trying to understand why the 2 machines
RAM/Memory resources on 7 STABLE
My Machine: Dell 2850 PE w/ 12 GB of Ram www# uname -a FreeBSD www 7.1-STABLE FreeBSD 7.1-STABLE #2: Tue Jan 6 19:24:57 EST 2009 r...@www:/usr/obj/usr/src/sys/DELL64 amd64 When I boot this machine it usually shows (in top) about 11 G Free in the Mem: line The machine, in this snippet, has been up for 5 days 22 hours and change and it now shows 1436M free in the Mem: line I've been watching the number and it has been slowly decreasing over the 5 days since its last boot. It looks like as the Free line trends down, the Inact value trends up to keep the total Mem used at the installed 12G I've never noticed this (the slow decline of Free) before on any machine I've had. Maybe that just means it has happened and I haven't noticed it, but I don't know. Is anyone familiar with this or if it means trouble or what might be the cause? Thanks Tim last pid: 67240; load averages: 0.16, 0.14, 0.10 up 5+22:44:26 12:32:54 109 processes: 1 running, 107 sleeping, 1 zombie CPU 0: 0.0% user, 0.0% nice, 1.5% system, 0.0% interrupt, 98.5% idle CPU 1: 0.0% user, 0.0% nice, 1.1% system, 0.0% interrupt, 98.9% idle CPU 2: 0.0% user, 0.0% nice, 1.1% system, 0.8% interrupt, 98.1% idle CPU 3: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Mem: 383M Active, 9507M Inact, 424M Wired, 129M Cache, 214M Buf, 1447M Free Swap: 2014M Total, 2014M Free ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
Tim Kellers kell...@njit.edu writes: My Machine: Dell 2850 PE w/ 12 GB of Ram www# uname -a FreeBSD www 7.1-STABLE FreeBSD 7.1-STABLE #2: Tue Jan 6 19:24:57 EST 2009 r...@www:/usr/obj/usr/src/sys/DELL64 amd64 When I boot this machine it usually shows (in top) about 11 G Free in the Mem: line The machine, in this snippet, has been up for 5 days 22 hours and change and it now shows 1436M free in the Mem: line I've been watching the number and it has been slowly decreasing over the 5 days since its last boot. It looks like as the Free line trends down, the Inact value trends up to keep the total Mem used at the installed 12G I've never noticed this (the slow decline of Free) before on any machine I've had. Maybe that just means it has happened and I haven't noticed it, but I don't know. Is anyone familiar with this or if it means trouble or what might be the cause? Thanks Tim last pid: 67240; load averages: 0.16, 0.14, 0.10 up 5+22:44:26 12:32:54 109 processes: 1 running, 107 sleeping, 1 zombie CPU 0: 0.0% user, 0.0% nice, 1.5% system, 0.0% interrupt, 98.5% idle CPU 1: 0.0% user, 0.0% nice, 1.1% system, 0.0% interrupt, 98.9% idle CPU 2: 0.0% user, 0.0% nice, 1.1% system, 0.8% interrupt, 98.1% idle CPU 3: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Mem: 383M Active, 9507M Inact, 424M Wired, 129M Cache, 214M Buf, 1447M Free Swap: 2014M Total, 2014M Free See the FreeBSD FAQ entry titled Why does top show very little free memory even when I have very few programs running?. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
On Fri, 16 Jan 2009 12:35:33 -0500 Tim Kellers kell...@njit.edu wrote: I've never noticed this (the slow decline of Free) before on any machine I've had. Maybe that just means it has happened and I haven't noticed it, but I don't know. FreeBSD has worked like that for a long time, it doesn't free memory as long as there's a better use for it. It just maintains a few percent free for interrupt handling. It's in the FAQ. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
Thanks to all who responded. I am familiar with the FAQ and what it says about memory handling. This is my first time with installed RAM over 8 Gig in an AMD environment so I was just making sure there wasn't something going on that looked odd to anyone else. Tim RW wrote: On Fri, 16 Jan 2009 12:35:33 -0500 Tim Kellers kell...@njit.edu wrote: I've never noticed this (the slow decline of Free) before on any machine I've had. Maybe that just means it has happened and I haven't noticed it, but I don't know. FreeBSD has worked like that for a long time, it doesn't free memory as long as there's a better use for it. It just maintains a few percent free for interrupt handling. It's in the FAQ. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
When I boot this machine it usually shows (in top) about 11 G Free in the Mem: line The machine, in this snippet, has been up for 5 days 22 hours and change and it now shows 1436M free in the Mem: line I've been watching the number and it has been slowly decreasing over the 5 days since its last boot. It looks like as the Free line trends down, the Inact value trends up to keep the total Mem used at the installed 12G ALL unused memory is used as disk cache in FreeBSD. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
On Fri, 16 Jan 2009 22:23:06 +0100 (CET) Wojciech Puchar woj...@wojtek.tensor.gdynia.pl wrote: When I boot this machine it usually shows (in top) about 11 G Free in the Mem: line The machine, in this snippet, has been up for 5 days 22 hours and change and it now shows 1436M free in the Mem: line I've been watching the number and it has been slowly decreasing over the 5 days since its last boot. It looks like as the Free line trends down, the Inact value trends up to keep the total Mem used at the installed 12G ALL unused memory is used as disk cache in FreeBSD. Although, looking at the output of top, most of the memory is in the inactive state. As I understand it cache pages go from active to cached, and the inactive queue contains pages that need to be written out to swap before they can be reused. The very high level of inactive memory looks suspiciously like a memory-leak to me. Hopefully someone who knows more about this will step in - don't take my word for it. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
On Sat, Jan 17, 2009 at 01:25:19AM +, RW wrote: On Fri, 16 Jan 2009 22:23:06 +0100 (CET) Wojciech Puchar woj...@wojtek.tensor.gdynia.pl wrote: When I boot this machine it usually shows (in top) about 11 G Free in the Mem: line The machine, in this snippet, has been up for 5 days 22 hours and change and it now shows 1436M free in the Mem: line I've been watching the number and it has been slowly decreasing over the 5 days since its last boot. It looks like as the Free line trends down, the Inact value trends up to keep the total Mem used at the installed 12G ALL unused memory is used as disk cache in FreeBSD. Although, looking at the output of top, most of the memory is in the inactive state. As I understand it cache pages go from active to cached, and the inactive queue contains pages that need to be written out to swap before they can be reused. No. It just means they're not active -- nothing has touched them recently. They may be dirty. They may not be. Recently means the last 20 seconds to a minute, depending. The very high level of inactive memory looks suspiciously like a memory-leak to me. Hopefully someone who knows more about this will step in - don't take my word for it. I have no data on the system in question, but it's very common for a machine to have large amounts of inactive memory, particularly one that's not under any sort of memory pressure. My basically idle workstation has 1.5 GB of memory, 5 MB free, and over a gig inactive. Since I'm not doing anything with it (I'm writing this from another machine), and its just hanging out, this is what I'd expect. Should it do something that requires memory, the pager will toss clean inactive pages to the free list, and they'll be reused. Of course, if what they're required for is something they already have in them (like the code segments of recently terminated application that's restarted), they'll get reused, saving having to read them from disk. The only time you'll large amounts of memory on the Free list is when a machine is first booted and hasn't touched that memory for anything, or when an application that's got a large dyanmically allocated block of memory terminates. The rest of the time, the free list should be small. If the machine isn't swapping, there's usually nothing to worry about. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: RAM/Memory resources on 7 STABLE
On Fri, 16 Jan 2009 21:14:10 -0500 David Scheidt dsche...@panix.com wrote: On Sat, Jan 17, 2009 at 01:25:19AM +, RW wrote: Although, looking at the output of top, most of the memory is in the inactive state. As I understand it cache pages go from active to cached, and the inactive queue contains pages that need to be written out to swap before they can be reused. No. It just means they're not active -- nothing has touched them recently. They may be dirty. They may not be. Do you know that for a fact, because it contradicts the description in Matt Dillon's VM-design article. The article say that clean pages go to the cache queue and dirty pages go to the inactive queue, and emphasizes the need to keep then separated. If clean pages do go to the inactive queue I'd be interested to know the reason. Since I'm not doing anything with it (I'm writing this from another machine), and its just hanging out, this is what I'd expect. Should it do something that requires memory, the pager will toss clean inactive pages to the free list, and they'll be reused. IIRC, according to the article when you're short of free memory (i.e. most of the time) it's allocated from the cache queue. The queues are rebalanced by flushing inactive pages and moving then to the cache queue, and by pages coming off the active queue. AFAIK pages are taken off the active queue when there is a significant need for rebalancing. I've seen memory hang about there pretty much indefinitely after I shut down kde/xorg - much longer than 20-60 seconds. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org