PDA

View Full Version : Memory Management




StuffMattSays
Jul 2, 2012, 12:34 AM
Hey, does anyone have the issue of ram on 10.7.4? I was running 2 apps and the 4GB of Ram maxes out! I checked the Apple Support Forums and it seems to be a common problem, does anybody know if it will be solved in Mountain Lion?



GGJstudios
Jul 2, 2012, 12:36 AM
Hey, does anyone have the issue of ram on 10.7.4? I was running 2 apps and the 4GB of Ram maxes out! I checked the Apple Support Forums and it seems to be a common problem, does anybody know if it will be solved in Mountain Lion?
What do you mean "maxes out?" Do you mean you're paging out?

StuffMattSays
Jul 2, 2012, 01:36 AM
As in the active memory becomes very high even with little to no apps open, to the point it freezes with the beachball. I have to use the app purge to fix this now

GGJstudios
Jul 2, 2012, 01:39 AM
As in the active memory becomes very high even with little to no apps open, to the point it freezes with the beachball. I have to use the app purge to fix this now
Purging free memory will only degrade performance, not improve it.

Launch Activity Monitor
Change "My Processes" at the top to "All Processes"
Click on the CPU column heading once or twice, so the arrow points downward (highest values on top).
Click on the System Memory tab at the bottom.
Take a screen shot (http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X) of the whole Activity Monitor window, then scroll down to see the rest of the list, take another screen shot
Post your screenshots (http://forums.macrumors.com/showpost.php?p=14126379&postcount=16).

dukebound85
Jul 2, 2012, 01:42 AM
Purging will improve performance if you have one app that is needing more ram. The only way it hurts performance is if one is switching between apps constantly and the contents would need to be rewritten.

I use the purge command all the time when working with large matlab variables and it helps quite noticeably.

OP: You can also purge the memory by simply typing purge in terminal as well

GGJstudios
Jul 2, 2012, 01:43 AM
Purging will improve performance if you have one app that is needing more ram.
If an app needs more RAM, inactive memory is available to it, without the need to purge it.

Mac OS X: Reading system memory usage in Activity Monitor (http://support.apple.com/kb/HT1342)
Inactive:

This information is in RAM but it is not actively being used, it was recently used.

For example, if you've been using Mail and then quit it, the RAM that Mail was using is marked as Inactive memory. Inactive memory is available for use by another application, just like Free memory. However, if you open Mail before its Inactive memory is used by a different application, Mail will open quicker because its Inactive memory is converted to Active memory, instead of loading it from the slower drive.

dukebound85
Jul 2, 2012, 01:47 AM
If an app needs more RAM, inactive memory is available to it, without the need to purge it.

No it isn't often times in my experience despite the mantra that inactive is equal to free.

In my dealings, that is simply not the case. The memory management in Lion frankly sucks. Purging the memory has yielded noticeable improvements when I need more ram during times when ram is being constrained to about having 5mb free yet inactive is maybe 2 gigs from past apps that were used.

StuffMattSays
Jul 2, 2012, 01:52 AM
Here they are, this only started to happen.
I'm on 10.7.4

GGJstudios
Jul 2, 2012, 01:53 AM
Here they are, this only started to happen.
I'm on 10.7.4
Please re-read the instructions, including the bolded step #2 and try again.

StuffMattSays
Jul 2, 2012, 02:01 AM
Sorry. New here

GGJstudios
Jul 2, 2012, 02:06 AM
Sorry. New here
You still have about 1GB of memory available and you have a very small amount of page-outs, so you're not greatly exceeding your available RAM.

One thing I notice is you're running Avast antivirus, which is using resources. You don't need 3rd party antivirus apps to keep your Mac malware-free.

Macs are not immune to malware, but no true viruses exist in the wild that can run on Mac OS X, and there never have been any since it was released over 10 years ago. The only malware in the wild that can affect Mac OS X is a handful of trojans, which can be easily avoided by practicing safe computing (see below). Also, Mac OS X Snow Leopard and Lion have anti-malware protection (http://support.apple.com/kb/ht4651) built in, further reducing the need for 3rd party antivirus apps.
Mac Virus/Malware FAQ (http://guides.macrumors.com/Mac_Virus/Malware_FAQ)

Make sure your built-in Mac firewall is enabled in System Preferences > Security > Firewall


Uncheck "Open "safe" files after downloading" in Safari > Preferences > General


Disable Java in your browser (Safari (http://support.apple.com/kb/HT5241), Chrome (http://www.podfeet.com/wordpress/tutorials/how-to-disable-java-in-chrome/), Firefox (http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets)). This will protect you from malware that exploits Java in your browser, including the recent Flashback trojan (http://support.apple.com/kb/HT5244). Leave Java disabled until you visit a trusted site that requires it, then re-enable only for the duration of your visit to that site. (This is not to be confused with JavaScript, which you should leave enabled.)


Change your DNS servers to OpenDNS servers by reading this (http://guides.macrumors.com/Mac_Virus/Malware_FAQ#Why_am_I_being_redirected_to_other_sites.3F).


Be careful to only install software from trusted, reputable sites. Never install pirated software. If you're not sure about an app, ask in this forum before installing.


Never let someone else have access to install anything on your Mac.


Don't open files that you receive from unknown or untrusted sources.


For added security, make sure all network, email, financial and other important passwords are long and complex, including upper and lower case letters, numbers and special characters.


Always keep your Mac and application software updated. Use Software Update for your Mac software. For other software, it's safer to get updates from the developer's site or from the menu item "Check for updates", rather than installing from any notification window that pops up while you're surfing the web.

That's all you need to do to keep your Mac completely free of any Mac OS X malware that has ever been released into the wild. You don't need any 3rd party software to keep your Mac secure.

If you still want to run antivirus for some reason, ClamXav (http://www.clamxav.com/) (which is free) is one of the best choices, since it isn't a resource hog, detects both Mac and Windows malware and doesn't run with elevated privileges. You can run scans when you choose, rather than leaving it running all the time, slowing your system. ClamXav has a Sentry feature which, if enabled, will use significant system resources to constantly scan. Disable the Sentry feature. You don't need it. Also, when you first install ClamXav, as with many antivirus apps, it may perform an initial full system scan, which will consume resources. Once the initial scan is complete, periodic on-demand scans will have much lower demands on resources.

nontroppo
Jul 3, 2012, 02:41 PM
I use Matlab extensively, I've never seen purge do any more than flush disk buffers (which is what it is supposed to do), which slows Matlab down. Purging is often voodoo.

GGJStudios is correct overall, and the vast majority of "complaints" are from people who do not understand how VM works in their OS (huge amounts of noise and very little signal when reading about this in forums). I've watched someone use a memory optimiser and say how much better having all the "green" RAM is, then see them just ignore the hang as they open a program, placebo effect of the worst kind...

However, there have been some more metered and knowledgeable claims that there is a bug in Lion, and Mountain Lion does include "virtual memory performance" as one of the new developer features, so until we get more details on what mountain lion may have fixed or improved, the question on a potential Lion bug is still somewhat in the air.

dukebound85
Jul 3, 2012, 02:48 PM
I use Matlab extensively, I've never seen purge do any more than flush disk buffers (which is what it is supposed to do), which slows Matlab down. Purging is often voodoo.

GGJStudios is correct overall, and the vast majority of "complaints" are from people who do not understand how VM works in their OS (huge amounts of noise and very little signal when reading about this in forums). I've watched someone use a memory optimiser and say how much better having all the "green" RAM is, then see them just ignore the hang as they open a program, placebo effect of the worst kind...

However, there have been some more metered and knowledgeable claims that there is a bug in Lion, and Mountain Lion does include "virtual memory performance" as one of the new developer features, so until we get more details on what mountain lion may have fixed or improved, the question on a potential Lion bug is still somewhat in the air.

While I have no doubt what you say is true, I run matlab variables that greatly exceed that of my ram capacity (on the order of 90gigs). Matlab likes to load all variables in ram before doing any sort of operations

In these cases, purging does indeed help in my experience by freeing up the ram that is inactive due to past applications and OSX essentially holding it for those apps if I were to run them again (and if that were the case, it would be quicker). However, when I am running matlab and will not be switching apps, it has been much better when purging

Just my experiences