shutdown vs restart
I have an Ibook with 768 MB of ram. If I have a bunch of programs open the reponse on my Ibook slows dramatically. I'd get more RAM but am not sure another 256k will make that much difference. What I usually do is restart.
1) Why doesn't closing apps do the trick?
2) Is there any advantage shutting down and manually restarting has over a plain restart?
1) Why doesn't closing apps do the trick?
2) Is there any advantage shutting down and manually restarting has over a plain restart?
Comments
Shutdown/start in theory shouldn't have any advantage over a restart, but there have been cases (rare, and I haven't heard of one in a few years) where hardware caches weren't get flushed on restart, but the shutdown/start cycle was enough to let the cache voltage drain. Restart should be just fine.
What OS version are you running? Prior to 10.4, closing apps did not recover virtual memory space, and there was often still quite a bit of swapping. I've noticed that, with some unknown 10.4.x update, I now (eventually) get back disk space after closing memory-hungry apps. This means that there's some cleanup going on behind the scenes to (possibly) compact VM into contiguous swap files. Restarting blows away the entire mess and starts over clean.
Shutdown/start in theory shouldn't have any advantage over a restart, but there have been cases (rare, and I haven't heard of one in a few years) where hardware caches weren't get flushed on restart, but the shutdown/start cycle was enough to let the cache voltage drain. Restart should be just fine.
10.3.9. So I guess that partially explains it. I assume there's no way to control an Apps memory usage like there was with OS 9?
The flipside, is of course, that you have to learn to trust the OS to handle a very complex task. One thing you can do, is to give it plenty of space (RAM) to work in. Give it enough elbow room for your average workload, and it can handle *huge* amounts of memory use over time. Right now, my 1GB MacBook has 15GB of virtual memory going, and it's chugging along just fine.
That's the tradeoff you get. 1GB is sort of the magic threshold past which most people's experience gets a lot smoother. If you regularly deal with an app that uses a massive chunk of memory, or multiple apps that you swap back and forth between, you may want to consider more.
Take a look at the Activity Monitor, System Memory. The Page in/out count. Ideally, page outs should be zero, in reality they should just be a very small percentage of the total. Adding more memory can help. Restarting every time you get a cup of coffee does too.., It is all about convenience and money.
I don't know about the page outs. I upgraded a machine that was almost unusable with 512MB Ram. After a restart, it was fine but after a couple of hours, it would just slow down so much that it would hang up for ages and to avoid throwing it out the window, you'd really just have to hold in the power button to force shut down. I really don't think that Tiger PPC was this bad with Ram, as the powerbooks are pretty smooth. Intel Tiger seems to be broken.
It was getting nearly 100,000 pageouts a day (I don't know if the number is a counter btw, in Leopard it is changed to megabytes). Anyway, after upgrading to 1GB, the performance difference is just incredible and yet the pageouts are still about 50,000 a day.
On a machine with 4GB Ram, there are a fraction of the number of pageouts but it still gets the beachball now and again and it rarely goes over the 2GB mark.
Overall, I agree with this conclusion:
1GB is sort of the magic threshold past which most people's experience gets a lot smoother.
Right now, my 1GB MacBook has 15GB of virtual memory going, and it's chugging along just fine.
The virtual memory size I don't understand because the size that activity monitor reports isn't the size of your virtual memory caches - you can check by going to /var/private/vm. I always found it a bit odd how the OS assigns it, it starts with smaller 64MB files and then jumps up to sizes as high as 512MB. I don't know if you've ever noticed your HD suddenly drop or gain half a gig of space, well that's it. I don't know why the OS can't assign a dynamic file.
Are you actually closing the apps or just the application's windows?
This is going to seem weird, but if you have a time when the computer is acting WAY too slow when you consider it's abilities, try quitting Safari if it's open. I've only seen this happen one one machine at work, but sometimes, for no reason, Safari will go from using the usual 50MB or so of RAM to about 500MB. Absolutely no idea why, and I've never seen it on any other machine, but it's worth a look.
Are you actually closing the apps or just the application's windows?
I quit them.
This is going to seem weird, but if you have a time when the computer is acting WAY too slow when you consider it's abilities, try quitting Safari if it's open. I've only seen this happen one one machine at work, but sometimes, for no reason, Safari will go from using the usual 50MB or so of RAM to about 500MB. Absolutely no idea why, and I've never seen it on any other machine, but it's worth a look.
If I'm not getting the performance increase by quitting apps I figure closing superflluos windows won't help, either. But if I were to do so, I'd go for the browsers first, as you suggest.
. . . Anyway, after upgrading to 1GB, the performance difference is just incredible and yet the pageouts are still about 50,000 a day.
On a machine with 4GB Ram, there are a fraction of the number of pageouts but it still gets the beachball now and again and it rarely goes over the 2GB mark.
Overall, I agree with this conclusion:
Originally Posted by Kickaha
1GB is sort of the magic threshold past which most people's experience gets a lot smoother.
:
Originally Posted by Kickaha
Right now, my 1GB MacBook has 15GB of virtual memory going, and it's chugging along just fine.
The virtual memory size I don't understand because the size that activity monitor reports isn't the size of your virtual memory caches - you can check by going to /var/private/vm. I always found it a bit odd how the OS assigns it, it starts with smaller 64MB files and then jumps up to sizes as high as 512MB. I don't know if you've ever noticed your HD suddenly drop or gain half a gig of space, well that's it. I don't know why the OS can't assign a dynamic file.
I don't get the VM stuff either. I did a google search--"using virtual memory in OS X"--and found this: As the usage of X increases with time without rebooting the kernel file system buffer cache will fill with the most needed or most frequently used data. This should help explain why some people claim that the system appears to perform better the longer they've been running X. The needed data for doing things (or maybe most of it) is now all resident in memory (the kernel's buffer cache) and doesn't need to be read from disk. This is much much faster.
As mentioned above, the kernel will expand its buffer cache on demand by using the free or unused memory in the machine. This explains that with time (could be a short period of time or a long period of time -- it depends on system usage/workload) the system appears to be using all of the available RAM per the Terminal's top command.
One other point to make is that if the kernel's buffer cache has grown to be quite large and is consuming a large percentage of the installed RAM there's no harm being done. If a new App is launched the kernel will release as much its buffer cache as needed. First it will release parts of the buffer cache that aren't 'dirty' until it figures it can honor the new App's memory demand. If by releasing all the non-dirty buffer segments it still requires more memory for the App then it will start writing the dirty segments of the buffer cache to disk and releasing their memory which in turn can be given to the new App. This stops when all the memory required by the new App is satisfied. In this manner the kernel buffer cache shrinks down in size. There's probably a minimum size to which it will shrink down to. In this case the kernel will start looking for other memory that's inactive. This could be a dormant App's memory. In this case the kernel will start to page out the dormant App's memory hoping to satisfy the new App's memory requirements. This kernel activity is called paging or swapping.
When the kernel starts to perform swapping it's a sign that the physical memory in the machine has been oversubscribed. Continual swapping will impact the overall system performance -- things will become unresponsive and much disk i/o seeking will be apparent/heard. This type of activity is displayed in the Terminal's top command with the value immediately preceding the "pageouts". If this number is non-zero and increasing rapidly over short periods of time then severe swapping is taking place. This is bad.
If severe swapping is taking place then either more RAM must be installed or the workload in the machine needs to be reduced. Of course the system will continue to run but not at its optimal performance levels.
I believe the above helps explain why people claim the X system performs better over time without intervening reboots and why the system consumes all of memory no matter how much RAM is installed.
This is a helpful explanation of the process (could the preference for "clean" over "dirty" memory explain the erratic assignments you note?) , and also contradictory. On the one hand it's suggesting system response improves over (up)time, and on the other it suggests that operatiing for a long stretch degrades performance. I assume the relevant point is whether there's enough RAM (if there is you get better performance over time; otherwsie you get worse)
I did a search and saw Transintl is selling 1 gig ram for $119. If I can get $30 for my old RAM that's probably my ticket to better performance.
With so little ram, nearing your storage capacity will dramatically slow down the computer. This is because the HD is being used as virtual memory and the fuller a HD gets, the slower it gets. The longer your computer is on, the fuller your HD gets as more things are cached to virtual memory.
This can't be stressed enough: A full harddrive and virtual memory will cause your computer to beachball constantly.