FROM : ajb.lists
DATE : Sat Nov 03 16:41:46 2007
On Nov 2, 2007, at 3:01 PM, John R. Timmer wrote:
> Using garbage collection resulted in a significant memory gain, but
> nowhere near bad enough to crash the program. Oddly, the memory use
> did not subside after the loop had finished.
This sounds like caching behavior that I think I've observed. My app
create millions of managed objects during an import process, and I've
seen large memory usage that doesn't go down when the objects are
dealloced. Looking at backtraces in ObjectAlloc, I see a lot of
mallocs in caching functions as various objects are dealloc'ed. If I
close the NSPersistentDocument, I get some memory reclaimed, but not
what I expect. But, if I repeated run the import (without quitting),
the peak memory doesn't go up, so the memory is apparently reused.
This leads me to a question about using ObjectAlloc (in Instruments on
Leopard) effectively, especially with respect to Core Data. When
looking at allocations, there are a large number of GeneralBlocks of
various sizes, but no NSManagedObjects. I have some custom
subclasses, too, and those aren't identified either in the Categories
column. I want to observe the usage patterns of the various entities
in my model, but I'm not sure how to do that. Is there an easy way to
filter managed objects?
Thanks,
----
Aaron Burghardt
<email_removed>
DATE : Sat Nov 03 16:41:46 2007
On Nov 2, 2007, at 3:01 PM, John R. Timmer wrote:
> Using garbage collection resulted in a significant memory gain, but
> nowhere near bad enough to crash the program. Oddly, the memory use
> did not subside after the loop had finished.
This sounds like caching behavior that I think I've observed. My app
create millions of managed objects during an import process, and I've
seen large memory usage that doesn't go down when the objects are
dealloced. Looking at backtraces in ObjectAlloc, I see a lot of
mallocs in caching functions as various objects are dealloc'ed. If I
close the NSPersistentDocument, I get some memory reclaimed, but not
what I expect. But, if I repeated run the import (without quitting),
the peak memory doesn't go up, so the memory is apparently reused.
This leads me to a question about using ObjectAlloc (in Instruments on
Leopard) effectively, especially with respect to Core Data. When
looking at allocations, there are a large number of GeneralBlocks of
various sizes, but no NSManagedObjects. I have some custom
subclasses, too, and those aren't identified either in the Categories
column. I want to observe the usage patterns of the various entities
in my model, but I'm not sure how to do that. Is there an easy way to
filter managed objects?
Thanks,
----
Aaron Burghardt
<email_removed>
| Related mails | Author | Date |
|---|---|---|
| ajb.lists | Nov 3, 16:41 | |
| Ben Trumbull | Nov 4, 00:08 | |
| ajb.lists | Nov 4, 12:27 | |
| Ben Trumbull | Nov 4, 23:36 | |
| Aaron Burghardt | Nov 5, 04:01 | |
| Chris Hanson | Nov 5, 04:28 |






Cocoa mail archive

