2KB leaks = 200MB resident memory?
2KB leaks = 200MB resident memory?
- Subject: 2KB leaks = 200MB resident memory?
- From: Z Rosen <email@hidden>
- Date: Sun, 3 Apr 2005 20:04:58 -0400
I have read the other postings on memory management; I have run tools
like leaks and ObjectAlloc; I'm still baffled.
I launch my application and 'top' shows me RPRVT: 6.29M RSHRD: 19.1M
RSIZE: 16.1M
I leave my application alone for several hours (basically doing
nothing) and resident private memory and resident shared memory both
become relatively large (compared to other running apps): RPRVT: 39.2M
RSHRD: 229M RSIZE: 167M
Without quitting the app, I run 'leaks' which tells me:
Process 12677: 90491 nodes malloced for 16710 KB
Process 12677: 43 leaks for 2256 total leaked bytes.
All of the leaks are deep within OS X code, but even still, only 2KB of
leaked memory shouldn't come close to the steady growth in resident
memory my app has shown. ObjectAlloc also shows that all of MY objects
are being released (the GeneralBlocks seem to grow though).
Without quitting, I run 'top' again and it now reports: RPRVT: 299M
RSHRD: 25.9M RSIZE: 67.9M
My questions are:
1) MEMORY GROWTH: If I'm not leaking memory and my program is idle,
why would my private AND shared memory usage grow? Does this have to
do with the GeneralBlocks growing in ObjectAlloc?
2) SHARED USAGE: Some people say that if you're not leaking memory
don't worry about memory usage, however it seems that I must be doing
something wrong when my app is referencing 10 times more shared memory
than any other process. Am I linking to too many shared libraries? Is
there a way to track down what's causing this or should I really just
not worry about it?
3) TOP'S CHANGE: Why would 'top' show such a significant change
between private and shared memory usage after running leaks? There was
no interaction with the application during this time. Why would so
much shared memory suddenly be marked private?
4) TOP'S RSIZE: On a side note, can anyone explain why RSIZE is not
the sum of RPRVT and RSHRD and why it is sometimes LESS than RSHRD?
Thanks for any insights you can lend.
Zach Rosen
Developer & President
reelintelligence.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden