Trying to understand "real memory" usage
Trying to understand "real memory" usage
- Subject: Trying to understand "real memory" usage
- From: Christopher Drum <email@hidden>
- Date: Fri, 11 Mar 2005 18:21:07 -0800
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
Check out FileWrangler, my five-star rated (MacUpdate, VersionTracker)
Cocoa app written in Objective-C for the batch renaming of files.
_______________________________________________
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