Re: How do I get memory usage numbers?

2012-08-15 Thread Greg Guerin

Charlie Dickman wrote:

What I want to do is determine the ratio of inactive to free in  
order to determine when to execute the purge command to free up the  
inactive memory before the system gets into trouble.



It's unnecessary to purge or free Inactive memory.

Quoting from:
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. EMPHASIS  
ADDED>>>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.



  -- GG


___

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


Re: How do I get memory usage numbers?

2012-08-13 Thread Alex Zavatone
Actually, when Safari is paging to the HD because it decided it needed to use 
5+ GB of RAM, purge is really useful in temporarily getting the Mac back to 
normal speed until the memory bloats again.

On Aug 13, 2012, at 5:54 PM, Jens Alfke wrote:

> 
> On Aug 13, 2012, at 2:01 PM, Charlie Dickman <3tothe...@comcast.net> wrote:
> 
>> What I want to do is determine the ratio of inactive to free in order to 
>> determine when to execute the purge command to free up the inactive memory 
>> before the system gets into trouble.
> 
> That's not what purge(1) does. It simply forces all resident pages to be 
> paged back out. It's not going to free up any address space, and it's not 
> going to speed up the system (rather, it'll slow it down a lot, as every 
> active process has to start hitting the disk to page its address space back 
> in.)
> 
> —Jens
> ___
> 
> 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/zav%40mac.com
> 
> This email sent to z...@mac.com


___

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

Re: How do I get memory usage numbers?

2012-08-13 Thread Jens Alfke

On Aug 13, 2012, at 2:01 PM, Charlie Dickman <3tothe...@comcast.net> wrote:

> What I want to do is determine the ratio of inactive to free in order to 
> determine when to execute the purge command to free up the inactive memory 
> before the system gets into trouble.

That's not what purge(1) does. It simply forces all resident pages to be paged 
back out. It's not going to free up any address space, and it's not going to 
speed up the system (rather, it'll slow it down a lot, as every active process 
has to start hitting the disk to page its address space back in.)

—Jens
___

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

Re: How do I get memory usage numbers?

2012-08-13 Thread Charlie Dickman
I'm using the system "say" command to speak phrases within my app. I've tried 
NSSpeechSynthesizer and Carbon's Speech Synthesis Engine but both have a 
serious memory leak problem which gets my app into trouble. By using the system 
"say" command I move the problem out of my app and into the system.

What I want to do is determine the ratio of inactive to free in order to 
determine when to execute the purge command to free up the inactive memory 
before the system gets into trouble.

On Aug 13, 2012, at 1:56 PM, David Duncan wrote:

> On Aug 12, 2012, at 7:10 PM, Charlie Dickman <3tothe...@comcast.net> wrote:
> 
>> Initially I'm interested in system wide memory usage (free, wired,active, 
>> inactive) but following on I might like numbers for just my process.
>> If hacking through Darwin is the only way to do this than never mind but 
>> with all of the programs out there that include these numbers there must be 
>> a better way to find out how it's done.
> 
> 
> What are you trying to debug?
> --
> David Duncan
> 

Charlie Dickman
3tothe...@comcast.net



___

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


Re: How do I get memory usage numbers?

2012-08-13 Thread David Duncan
On Aug 12, 2012, at 7:10 PM, Charlie Dickman <3tothe...@comcast.net> wrote:

> Initially I'm interested in system wide memory usage (free, wired,active, 
> inactive) but following on I might like numbers for just my process.
> If hacking through Darwin is the only way to do this than never mind but with 
> all of the programs out there that include these numbers there must be a 
> better way to find out how it's done.


What are you trying to debug?
--
David Duncan

___

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


Re: How do I get memory usage numbers?

2012-08-13 Thread Jens Alfke

On Aug 12, 2012, at 7:10 PM, Charlie Dickman <3tothe...@comcast.net> wrote:

> Initially I'm interested in system wide memory usage (free, wired,active, 
> inactive)

Hm, I've always found those numbers to be nearly useless, but YMMV.

> If hacking through Darwin is the only way to do this than never mind but with 
> all of the programs out there that include these numbers there must be a 
> better way to find out how it's done.

It's not 'hacking' exactly, just a bunch of low-level C APIs with too few 
vowels in their names. If you've ever used sysctl or ioctl it's the same genre. 
I'm fairly sure that's what everyone uses, because every time this question 
comes up, the advice is to go look at 'top'.

—Jens
___

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

Re: How do I get memory usage numbers?

2012-08-12 Thread Charlie Dickman
Initially I'm interested in system wide memory usage (free, wired,active, 
inactive) but following on I might like numbers for just my process.
If hacking through Darwin is the only way to do this than never mind but with 
all of the programs out there that include these numbers there must be a better 
way to find out how it's done.

On Aug 12, 2012, at 7:17 PM, Jens Alfke wrote:

> 
> On Aug 12, 2012, at 3:21 PM, Charlie Dickman <3tothe...@comcast.net> wrote:
> 
>> How do I get system memory usage numbers within my app?
> 
> What kind of memory usage numbers? There are a lot of different ones — take a 
> look at the man page for 'top', or at all the different views in Activity 
> Monitor. And do you want them for all processes or just your own?
> 
> (The general answer is to go look up the source to 'top' in the Darwin open 
> source repo and see how it does it. It's using some low-level system calls 
> that I don't believe are documented otherwise.)
> 
> —Jens

Charlie Dickman
3tothe...@comcast.net



___

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

Re: How do I get memory usage numbers?

2012-08-12 Thread Jens Alfke

On Aug 12, 2012, at 3:21 PM, Charlie Dickman <3tothe...@comcast.net> wrote:

> How do I get system memory usage numbers within my app?

What kind of memory usage numbers? There are a lot of different ones — take a 
look at the man page for 'top', or at all the different views in Activity 
Monitor. And do you want them for all processes or just your own?

(The general answer is to go look up the source to 'top' in the Darwin open 
source repo and see how it does it. It's using some low-level system calls that 
I don't believe are documented otherwise.)

—Jens
___

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