Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Virtual memory mechanics on a 1.5GB system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Virtual memory mechanics on a 1.5GB system





Peter Bierman wrote:
At 1:19 AM +0000 2/21/07, Jose Commins wrote:
Not a problem, more of curiosity of operation. Say I launch an app. I get the app to start loading media. When (Wired + Active) reaches 1070MB on my 1.5GB system, no matter what I do it continues paging with (Wired + Active) staying at the same value, with 'Inactive + Free' at 466MB. Correct me if I'm wrong, it looks like the system is holding onto that 466MB, so in Real Life only 1GB of my system's 1.5GB memory is actually physically usable by an application?


I think your confusion is with "inactive" memory.

Inactive memory is not free memory. It's not even really "inactive". It's more like "not used as recently as most of the other memory, but still in use".

So:

Before:
PhysMem: 170M wired, 896M active, 451M inactive, 1.48G used, 17.2M free


After:
PhysMem: 174M wired, 889M active, 455M inactive, 1.48G used, 16.8M free


In both cases, your machine is using pretty much all available RAM. (1.48G used) The approximately 16MB free is there so apps can grab memory without waiting for the VM system to free up some space. It can quickly and temporarily drop, but the VM system will attempt to keep some memory free.


-pmb



Aha! Your excellent explanation made it all clear to me! Just to be sure, at the moment I am running 'the big app' that is consuming most of the memory, and have been loading lots of other apps to test how the whole shebang operates with this in mind. If I get you right, the 'inactive' memory therefore is considered a candidate for paging?


So, App A allocates 1GB of RAM,
App A so far is using the first 512MB,
System after certain conditions puts the other 512 into the 'inactive' list to page out if necessary (i.e. Big App 2 is launched and requests memory).
(Did I get this right?)


I have noticed that 'inactive' stays the same no matter what I load once I reach a certain limit (as per the readouts above). Is it set to any particular ratio when memory becomes tight?

The app I am writing has to be of extremely high performance so I have to get my head round one area of OSX I am not familiar with - memory management, to understand how best to operate within!

Regards,
         Jose.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Virtual memory mechanics on a 1.5GB system (From: Jose Commins <email@hidden>)
 >Re: Virtual memory mechanics on a 1.5GB system (From: Michael Smith <email@hidden>)
 >Re: Virtual memory mechanics on a 1.5GB system (From: Jose Commins <email@hidden>)
 >Re: Virtual memory mechanics on a 1.5GB system (From: Peter Bierman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.