Skip navigation.
 
mlRe: vm thrashing - how to detect
FROM : Ben Dougall
DATE : Tue Apr 05 05:07:09 2005

On Monday, April 4, 2005, at 02:32  pm, Gerriet M. Denkmann wrote:

> I have an app which uses lots of memory in a random fashion.
> So, if it uses more memory than physical available, it gets incredible 
> slow - spending all its time swapping memory pages in and out.
> This is clearly not acceptable.
>
> I would like to detect this condition, and then switch to an alternate 
> algorithm which uses no more memory (but runs somewhat slower).
>
> Question: how can my app find out if it uses "too much" memory?
>
> I tried getrusage() but the only values non-zero are user time, 
> system time, block output operations, and voluntary context switches.
> The page reclaims and page fault fields are always zero and so useless.
>
> The point of things going bad is clearly visible in Activity Monitor: 
> the free memory goes down to a few MB, page in and out suddenly start 
> going up (from very few to hundreds per second) and the CPU percentage 
> of my app goes down from 80% to 20%.
>
> But how can my app get these values?


<http://www.omnigroup.com/mailman/archive/macosx-dev/2001-August/
018559.html
>

Related mailsAuthorDate
mlvm thrashing - how to detect Gerriet M. Denkman… Apr 4, 15:32
mlRe: vm thrashing - how to detect Ben Dougall Apr 5, 05:07