• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trying to intentionally create a memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Trying to intentionally create a memory leak (From: Jake <email@hidden>)
 >Re: Trying to intentionally create a memory leak (From: "Sherm Pendley" <email@hidden>)
 >Re: Trying to intentionally create a memory leak (From: "Ken Ferry" <email@hidden>)

  • Prev by Date: Re: NSTextView changes font
  • Next by Date: Re: best time to alter GUIs
  • Previous by thread: Re: Trying to intentionally create a memory leak
  • Next by thread: Re: Trying to intentionally create a memory leak
  • Index(es):
    • Date
    • Thread