Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] Determining Memory used by application under OSX? (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Next thread: [MBS] Mailing list archive update


[MBS] Mailing list archive update   -   Christian Schmitz
  [MBS] Determining Memory used by application under OSX?   -   Mike D.
    [MBS] Re: Determining Memory used by application under OSX?   -   Mike D.
     Re: [MBS] Re: Determining Memory used by application under OSX?   -   Christian Schmitz

[MBS] Determining Memory used by application under OSX?
Date: 30.01.03 20:02 (Thu, 30 Jan 2003 11:02:11 -0800)
From: Mike D.
Is there an easy way in a Carbon app under OSX to determine the total
amount of memory used by your application?

Runtime.memoryUsed doesn't work because it fails to count image buffers.
FreeMem() returns 20MB always under OSX.

I'm trying to allow my application to cache as much memory as
possible without spilling over into virtual memory.

[MBS] Re: Determining Memory used by application under OSX?
Date: 30.01.03 20:17 (Thu, 30 Jan 2003 11:17:45 -0800)
From: Mike D.
>Is there an easy way in a Carbon app under OSX to deteremine the
>total amount of memory used by your application?
>
>Runtime.memoryUsed doesn't work because it fails to count image buffers.
>FreeMem() returns 20MB always under OSX.
>
>I'm trying to allow my application to cache as much memory as
>possible without spilling over into virtual memory.

Answered my own question. I believe that using the MBS plugin, this
will tell how much physical RAM is left under OSX:

vms = GetDarwinVMStatisticsMBS
physicalRAMAvail = vms.freepages * vms.pagesize

Re: [MBS] Re: Determining Memory used by application under OSX?
Date: 30.01.03 22:48 (Thu, 30 Jan 2003 22:48:02 +0100)
From: Christian Schmitz
> >Is there an easy way in a Carbon app under OSX to deteremine the
> >total amount of memory used by your application?

I've on the list to make an application like top in RB.

> Answered my own question. I believe that using the MBS plugin, this
> will tell how much physical RAM is left under OSX:
>
> vms = GetDarwinVMStatisticsMBS
> physicalRAMAvail = vms.freepages * vms.pagesize

That should work, but don't forget to check for nil and for the case the
values are 0.

Mfg
Christian