Re: Virtual memory leaks...
Re: Virtual memory leaks...
- Subject: Re: Virtual memory leaks...
- From: David Leimbach <email@hidden>
- Date: Wed, 2 Mar 2005 13:35:41 -0800
I've done a little vm logging in my time too.
I used mach_override [http://rentzsch.com/mach_override/]
To catch calls to vm_allocate and vm_deallocate. These are the system calls
that actually work behind the scenes of Mac OS X's malloc/free implementation
mach_override will let you "hook into" all calls to
vm_allocate/vm_deallocate and
from there you can call the original function and add any sort of
logging before and
after the real function runs.
The Mac OS X malloc implementation does a lot of "pooling" in that not
all malloc calls
are going to call vm_allocate and not all free calls are going to call
vm_deallocate.
If you do some experimentation you'll probably see this for yourself.
Also the source is available
to libSystem and its constituent parts.
Dave
On Wed, 02 Mar 2005 12:10:49 -0800, Michael Burbidge <email@hidden> wrote:
> We have a very large application that uses a couple of dozen libraries
> from various sources. Our application is leaking virtual memory.
> Periodically, there is a 1 Mb bump in virtual memory, which is never
> reclaimed. Over time, several days, the accumulative affects of this
> leak are that we run out of virtual memory. We've tried all the
> standard tools such as leaks, and MallocDebug, but our application is
> too large for these. They either crash or slow our application down to
> the point that it is useless.
>
> I'm wondering if there is someway for me to get my hooks into the
> system allocator. If so, everytime I see a 1 Mb bump in virtual memory
> I could log the stack to a file. The stack may lead me to the leak.
>
> Any suggestions would be appreciated.
>
> Michael-
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden