Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Travisimo

macrumors 6502a
Original poster
Dec 22, 2009
991
226
I have an iMac running Snow Leopard with 8GB of physical RAM. When I first boot my computer, it runs super smooth with no problems to speak of. However, I leave my computer on all the time, and after a while, the system runs very sluggish. I have iStat Menus running and it shows my RAM usage.

Over time, my system will show very little free RAM and a LOT of "inactive" memory. For example, right now it shows the following:

Wired = 543 MB
Active = 3.61 GB
Inactive = 3.77 GB
Free = 145 MB

And so, my system is constantly swapping pages out and in which makes my system very sluggish. I realize the wired and active memory is running current applications, but the inactive memory is not being utilized. And so the system keeps paging instead of clearing the inactive.

And like I said, it starts out fine after a clean reboot, but I'd rather not have to reboot my computer every time I use it. Isn't there a way to clear out the virtual memory? Or at least something that will help my system use memory that is inactive? I have 8GB of RAM for goodness sake... the system should run smoothly pretty much all the time!

Thanks.
 
I have an iMac running Snow Leopard with 8GB of physical RAM. When I first boot my computer, it runs super smooth with no problems to speak of. However, I leave my computer on all the time, and after a while, the system runs very sluggish. I have iStat Menus running and it shows my RAM usage.

Over time, my system will show very little free RAM and a LOT of "inactive" memory. For example, right now it shows the following:

Wired = 543 MB
Active = 3.61 GB
Inactive = 3.77 GB
Free = 145 MB

And so, my system is constantly swapping pages out and in which makes my system very sluggish. I realize the wired and active memory is running current applications, but the inactive memory is not being utilized. And so the system keeps paging instead of clearing the inactive.

And like I said, it starts out fine after a clean reboot, but I'd rather not have to reboot my computer every time I use it. Isn't there a way to clear out the virtual memory? Or at least something that will help my system use memory that is inactive? I have 8GB of RAM for goodness sake... the system should run smoothly pretty much all the time!

How do you know it is swapping pages out and in? That's not how "inactive memory" works. Are you just making assumptions here? Have a look at Disk Activity in Activity Monitor. What does that say? What is your CPU usage?
 
How do you know it is swapping pages out and in? That's not how "inactive memory" works. Are you just making assumptions here? Have a look at Disk Activity in Activity Monitor. What does that say? What is your CPU usage?

Well, I can audibly hear my hard drive whenever I get the lag while doing something in an application. And iStat Menus shows the number of Page Ins and Page Outs, which are currently at 3,811,987 and 360,213 respectively (of course, my computer has been running for several days). It shows the current swap file size at 1.96 GB.

CPU usage is low (my iMac is quad-core and I'm not doing anything cpu-intensive). But over time, a lot of activities stutter, whereas they are perfectly smooth when I first boot and the free memory is higher. Even after I shut down memory-intensive apps, it seems like it really does not make the system run smoother until I reboot. For example, I'll have both Lightroom and iMovie running to work on a video project. Obviously, these both use a lot of memory. But even after I quit out of them, the system still stutters until I reboot. It's almost like it does not actually free up the memory for use after I quite an application.
 
Either get an SSD or wait for Lion to (hopefully) improve things.
 
Okay, here's what mine currently shows:

VM size: 240.56 GB
Page ins: 15.00 GB
Page outs: 1.38 GB
Swap used: 1.94 GB

Now what?
The page outs are cumulative and the swap used represents the current size of your swap file. It doesn't decrease as swap requirements are reduced. Try restarting to reset those numbers and then monitor it to see what activities increase swap. At some point since you last rebooted, you had sufficient demands that swap occurred, but that doesn't mean it's still happening.
 
my biggest thing to eat ram is mozilla it swells to almost 2 gigs and my swap and page out then get close to that them selves so everything slows i have to do a force quite then every thing is fine for about 3hrs and it does it again mhy inacitve is fine but active ram is used is huge cause of mozilla its a mem hog
 
The page outs are cumulative and the swap used represents the current size of your swap file. It doesn't decrease as swap requirements are reduced. Try restarting to reset those numbers and then monitor it to see what activities increase swap. At some point since you last rebooted, you had sufficient demands that swap occurred, but that doesn't mean it's still happening.

Thanks for your description. My concern isn't so much that swap occurred during heavy demands. Sometimes, for example, I will have a lot of things running like Chrome (with many tabs), Lightroom, and an instance of Windows 7 with Parallels. Under those circumstances, I can understand when swap occurs.

My main concern is that my system continues to run poorly even when I have closed some of those apps and my load has decreased. I'll have to do the reboot and continuously monitor things to know for sure, but it certainly seems like it continues to swap even when I have closed a lot of these apps. It's almost as if it does not free up the RAM that was being used by these programs, but continues to use the swap file until my next reboot.
 
... it certainly seems like it continues to swap even when I have closed a lot of these apps. It's almost as if it does not free up the RAM that was being used by these programs, but continues to use the swap file until my next reboot.
That's not normal Mac OS X behavior, as it does a good job of managing memory without the need for rebooting. I'd keep an eye on Activity Monitor to see what's using system resources at times when things are running slow.
 
My main concern is that my system continues to run poorly even when I have closed some of those apps and my load has decreased. I'll have to do the reboot and continuously monitor things to know for sure, but it certainly seems like it continues to swap even when I have closed a lot of these apps. It's almost as if it does not free up the RAM that was being used by these programs, but continues to use the swap file until my next reboot.

If you used up all RAM so that some things have been thrown out of RAM, and you then exit some applications, the things that were thrown out don't come back my magic - they have to swapped in again. That doesn't happen immediately.
 
..
Wired = 543 MB
Active = 3.61 GB
Inactive = 3.77 GB
Free = 145 MB

And so, my system is constantly swapping pages out and in ..

Really? How would you know that from the above?

Second. You don't care at all about pages being swapped in. That is the normal was UNIX-like system load programs into RAM from disk. Typically the system shoud not have to swapp data out because the program is already there on disk.

What you care bout are swap outs. This means RAM is full and "something had to go". Look at Activity Monitor and look at the Swap out rate. If it is comparable to swap ins then you have a problem.
 
but it certainly seems like it continues to swap even when I have closed a lot of these apps. It's almost as if it does not free up the RAM that was being used by these programs, but continues to use the swap file until my next reboot.

That is exactly what it does. The system will not free up RAM until it needs it. If the system is well designed then all of the RAM should be given some productive use even if that is only to hold old data just in case it is needed. Free RAM is wasted RAM.

One question: When you close programs you don't need are you actually "quitting" them or only clicking the red button to close the display. Killing the windows does not quit the program.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.