Re: Trying to intentionally create a memory leak
Re: Trying to intentionally create a memory leak
- Subject: Re: Trying to intentionally create a memory leak
- From: Bill Bumgarner <email@hidden>
- Date: Fri, 7 Mar 2008 19:01:49 -0800
On Mar 7, 2008, at 6:12 PM, Ken Ferry wrote:
Also, it happens that numbers -1 through 12 (I think) are uniqued, so
[[NSNumber alloc] initWithInteger:5] won't leak either.
This isn't something to count on, of course.
In general, if you want to leak something on purpose, leak NSObjects
or subclasses. The mutable collection classes are are relatively non-
surprising to leak, too.
If you want some real fun, set up a couple of timers that call various
methods at non-integral intervals (so you get beating effects) that do
different, non-synchronizing, things to your state. Then add threads.
Then try and figure out how to use the debugging tools to figure out
what went wrong.
malloc_history is a huge help.
Also, you'll probably want to turn on MallocScribble to wipe out any
bits of diagnostic help done by the runtime so as to better simulate
real world debugging in production systems.
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden