On Nov 6, 2012, at 8:08 AM, Alex Zavatone <z...@mac.com> wrote:

> 
> On Nov 6, 2012, at 9:23 AM, Jean-Daniel Dupas wrote:
> 
>> 
>> Le 6 nov. 2012 à 12:13, Tom Davie <tom.da...@gmail.com> a écrit :
>> 
>>> 
>>> On 6 Nov 2012, at 11:01, Nick Rogers <roger...@mac.com> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> Thanks for the replies.
>>>> I was trying to achieve what essentially "free memory" apps on the Mac 
>>>> AppStore do.
>>>> The RAM usage can be divided into four parts as shown in Activity Monitor.
>>>> 1. Free
>>>> 2. In-active
>>>> 3. Active
>>>> 4. Wired
>>>> 
>>>> When I used my earlier app to allocate memory equal to free + inactive 
>>>> bytes, for the execution of the program it used to make the system less 
>>>> responsive for a few seconds and on release and quitting the app, most of 
>>>> the inactive memory would shift under free.
>>>> 
>>>> e.g. if free is 1GB and inactive is 1.5GB, then after run, free would be 
>>>> 2.45GB and inactive just 50MB.
>>> 
>>> Why on earth would you want to release inactive memory?  This is memory 
>>> that is in use by applications, just ones that haven't been scheduled in 
>>> for a while.  This RAM IIRC is automatically paged out to disk, so that if 
>>> it is needed it can simply be overwritten, just like free memory, but has 
>>> the side benefit that if it's not overwritten, then the inactive 
>>> applications  can be brought back to life very fast.
>> 
>> The memory is paged out to disk only if it is read-write memory that was 
>> modified, and is not already on the disk. All mapped frameworks, the full 
>> content of the "Unified Buffer Cache" (which generally represent most of the 
>> inactive memory) and other stuff are keep in RAM to provide faster access, 
>> but are already present on disk and will be simply discarded if the system 
>> need more RAM.
>> 
>> So not only freeing inactive memory is useless, but it is also guarantee to 
>> make your system slower.
> 
> Actually, that's not always the case.  As I use Safari through out the day, 
> Safari ends up eating 6 to 12 GB of data on my 16 GB system.  Frequently, I 
> need to issue a purge to get back a spare GB or few hundred MB.  Plus, if 
> you're booting off, or have your swap file on an SSD disk related performance 
> penalties will be much less than if using an HD to hold the swap file.  

Memory remains the target of much superstition. The OS will take care of 
managing memory--you don't need to do it. Common utilities like Activity 
Monitor and Task Manager have given micro-managing users an excuse to 
second-guess their OS, which is rarely wise.

Preston


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to