Re: leaks and MallocStackLogging
Re: leaks and MallocStackLogging
- Subject: Re: leaks and MallocStackLogging
- From: Shawn Protsman <email@hidden>
- Date: Wed, 16 Jul 2008 16:08:24 -0700
I think I may have solved the issue. I moved the sleep from before the
function call to just above my return. I'm now getting output from
leaks.
while (1) { sleep(15); break; }
return(0);
--Shawn
On Jul 16, 2008, at 3:42 PM, Shawn Protsman wrote:
I think I'm using `leaks` improperly. I put a pause in the program
before it begins its work using `while`:
while (1) { sleep(15); break; }
myFunction( blah, blah, blah );
I start the program I suspect has a leak which should wait 15
seconds and then start its work and exit when finished. While that
starts and is sleeping for those few seconds, I switch to another
tab in Terminal and start leaks. leaks immediately ends after I
start is and prints a few lines to the screen while the program
(testkey) is still sleeping.
Here is the output of my testkey app (the while loop begins right
after "<TestKey> starting"):
@naiad ~/workspace/allkeyrtv-1.0.5-beta] ./testkey2
testkey2(20354) malloc: recording malloc stacks to disk using
standard recorder
testkey2(20354) malloc: stack logs being written into /tmp/stack-
logs.20354.testkey2.NWlrIg
<TestKey> starting
fdExceptSet : <0>
fdSetRead : <0>
fdSetWrite : <128>
Select Returned FileDescriptor: <1>
Socket Number : <7>
Unkown errno value <0>
<2>
ALLKeyRtv results:
Key name: <Key01-128 >
Instance Requested: < >
Key Size : <128> Key Format: <1>
Instance used: <K1NEeOKSVqP3xIrYuB8uNA==>
Expiration: <00000000>
Last rolled date: <20080705>
Return: <0>
testkey2(20354) malloc: stack logs deleted from /tmp/stack-logs.
20354.testkey2.NWlrIg
Here is the output of leaks:
@naiad ~/workspace/allkeyrtv-1.0.5-beta] leaks testkey2
Process 20361: 12 nodes malloced for 5 KB
Process 20361: 0 leaks for 0 total leaked bytes.
Any ideas on how to make leaks run during the entire time `testkey2`
is running?
--Shawn
On Jul 16, 2008, at 2:40 PM, Shawn Protsman wrote:
Duh and Doh!
$ export MallocStackLogging=1
--Shawn
On Jul 16, 2008, at 2:32 PM, Shawn Protsman wrote:
Novice `leaks` question if you please. We believe we have a mem
leak in an app here in the office. The 'leaks' manpage mentions
"If the environment variable "MallocStackLogging" is set when the
inspected program is started, leaks ..." How do I set this? Is it
to be included in my Makefile?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden