• 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
Does cocoa just leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Does cocoa just leak?


  • Subject: Does cocoa just leak?
  • From: Rosyna <email@hidden>
  • Date: Sat, 29 Sep 2001 20:37:36 -0700

I was trying to do a mem test on my app today. First trying to get a base reading, before anything else occurred. So I have a window with a pulsing button on it connected to some action. Thats all I have on it. I launch the app, then go into top to see the mem usage. Ok. Then I switch back to my app and notice the mem usage goes up. Switch back to the terminal, mem usage goes back again. Try switching in and out again, nothing happens. I think, "Oh well, must be a fluke" So I switch in and out about 15 more times. After about every dozen or so switches mem usage goes up a few k. And this is with an App that wasn't doing anything.

To test my class I was doing:

for (i=0;i<5000;i++)
[instance URL];

This causes mem usage to go up about 500k. Thats not too bad, i guess. I set the URL thats returned to autorelease inside the class. However, doing:

for (i=0;i<5000;i++)
[[instance URL] path];

Causes the mem usage to go up to 5megs! thats a 4.5meg increase over "base"!

and path is part of NSURL.

Now for the button on my application. Again, I was trying to get a base mem level. All the button does when clicked is show an NSOpenPanel. I opened it, mem use skyrocketed (compared to "base") nearly tripling in value. I closed it to see if I could regain that mem back, only about a .8 megs was returned. I do understand that it gives my app an Open Panel to use so It doesn't have to keep loading it over and over. Understanding that, I opened it and closed it a few more times, each time all but .01-.05megs was returned to me.

Granted I could be doing something horribly wrong, but the Mem usage seems odd to me. The above loops were done in awakeFromNib.
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insane People


  • Follow-Ups:
    • Re: Does cocoa just leak?
      • From: Vince DeMarco <email@hidden>
    • Re: Does cocoa just leak?
      • From: j o a r <email@hidden>
    • Re: Does cocoa just leak?
      • From: "John C. Randolph" <email@hidden>
    • Re: Does cocoa just leak?
      • From: Peter Ammon <email@hidden>
References: 
 >Re: Makin' frameworks (From: Andreas Monitzer <email@hidden>)

  • Prev by Date: Re: Argh! Mac OS X 10.1 -- PB Dies
  • Next by Date: Re: Does cocoa just leak?
  • Previous by thread: Re: Makin' frameworks
  • Next by thread: Re: Does cocoa just leak?
  • Index(es):
    • Date
    • Thread