Memory Managementhttp://www.maclife.com/taxonomy/term/12665/all
enTerminal 101: Managing Memory in Mountain Lionhttp://www.maclife.com/article/columns/terminal_101_managing_memory_mountain_lion
<!--paging_filter--><p><img src="/files/u12635/terminal_101_teaser_24.png" width="150" height="150" class="graphic-right" /><em>Every Monday, we'll show you how to do something new and simple with Apple's built-in command line application. You don't need any fancy software, or a knowledge of coding to do any of these. All you need is a keyboard to type 'em out!</em><br /><br />Keeping an eye on your Mac’s memory usage can bes vital for making your applications run faster and eliminate those that eat away at your virtual memory. You can do this right from within Terminal without any specialized apps using various commands.</p><h3>Top</h3><p><a class="thickbox" href="/files/u12635/mem_1.png"><img src="/files/u12635/mem_1.png" width="620" height="435" class="thickbox" /></a></p><p>To view the amount of memory that you have free and are currently using, open the Terminal and type “top” followed by the enter key. This top command will return a few rows near the top of the Terminal window. Look for the “PhysMem” and “VM” rows. <br /><br />In the “PhysMem” row, you can see how much memory is wired, active, inactive, used, and free. This is measured in gigabytes (“G”), megabytes (“M”), or kilobytes (“K”). PhysMem refers to the physical memory installed in your Machine; however, “VM” refers to the virtual memory that is allocated on your disk whenever your Mac runs out of physical memory. “VSIZE” indicates the amount of virtual memory OS X has assigned for processes or applications. <br /><br />Once you are finished looking at the information provided by the top command, press the Q key to quit back to the command prompt.</p><h3>Purge</h3><p><a class="thickbox" href="/files/u12635/mem_2.png"><img src="/files/u12635/mem_2.png" width="620" height="435" class="thickbox" /></a></p><p>While OS X has really good memory management, it’s not perfect. Sometimes RAM can be held in the “inactive” state, even when no longer needed. To free up some of your RAM for availability, try the “purge” command in the Terminal.<br /><br />If you monitor your “Free,” “Used,” and “Inactive” memory stats before and after the purge, you will find dramatic changes. In addition to your physical memory, this command will also relieve disk and memory caches to be emptied. This command gives you the same benefits of rebooting, except your applications can stay running. <br /><br />If you are a power user who uses applications that can occasionally hog disk and memory resources, then running this command can make your Mac feel more responsive. <br /><br /><em>Cory Bohon is a freelance technology writer, indie Mac and iOS developer, and amateur photographer. Follow this article's author, <a href="http://twitter.com/coryb" target="_blank">Cory Bohon on Twitter</a>.</em></p>http://www.maclife.com/article/columns/terminal_101_managing_memory_mountain_lion#commentsColumnsfree memoryMacMemory ManagementOS XpurgeRAMTerminalTerminal 101topVirtual MemoryMacMon, 20 Aug 2012 17:15:19 +0000Cory Bohon14846 at http://www.maclife.com