• 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 understand "real memory" usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to understand "real memory" usage


  • Subject: Re: Trying to understand "real memory" usage
  • From: Darkshadow <email@hidden>
  • Date: Fri, 11 Mar 2005 21:40:54 -0500

For some reason, the first time you launch an application it uses more memory than later launches do. When you recompile the application, the first launch after that does the same. Try quitting it then launching it again.

Darkshadow (aka Michael Nickerson)


On Mar 11, 2005, at 9:21 PM, Christopher Drum wrote:

I have a really simple little app I'm working on, and am implementing undo/redo for some of the more "volatile" user operations (like deletion of objects). I'm looking at Process Viewer to see whether I'm experiencing memory leaks while performing certain potentially leaky operations, but noticed something else I'm stumped by.

About an hour ago I launched my app and Process Viewer said I was using 6.5MB of real memory. I implemented a few more undo operations using prepareWithInvocationTarget:, after seeing that my previously implemented undo/redo operations for certain functions was working smoothly.

Now when I launch the app, Process Viewer says my app is using 16.35MB of real memory. The only thing I've added to my code is seven prepareWithInvocationTarget: lines of code. Does this method, simply by its inclusion in the code jump the real memory usage up that drastically? I've tried cleaning my targets and recompiling, but to no avail. I simply cannot account for this doubling of real ram usage in the space of one hour and seven lines of code. I've also set the number of undo levels to something low, like 5 or 1 with no change in the ram usage. I don't think the inclusion of that code is the problem, because I commented out a number of those lines and the memory usage remained constant.

Any ideas? Is this even anything I should really be concerned about? I think I've been pretty efficient at not sucking down memory unnecessarily, and my app is really, really simple (the app itself is only 300K, which includes 200K of graphics) and consists primarily of an NSMutableArray of custom class objects, each of which stores maybe six ints and a few strings... nothing fancy. Does the number of methods included in a custom class increase the application's memory usage?

What resources can the list suggest for understanding how memory gets used and how to optimize memory usage in general? Are there any general guidelines for knowing if a program is using "too much" memory?


------------------------------------------------------------------ Christopher Drum http://homepage.mac.com/christopherdrum



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Trying to understand "real memory" usage
      • From: Christopher Drum <email@hidden>
References: 
 >Trying to understand "real memory" usage (From: Christopher Drum <email@hidden>)

  • Prev by Date: Startup Items
  • Next by Date: Re: Startup Items
  • Previous by thread: Trying to understand "real memory" usage
  • Next by thread: Re: Trying to understand "real memory" usage
  • Index(es):
    • Date
    • Thread