Re: Xcode 4.3.1 memory usage
Re: Xcode 4.3.1 memory usage
- Subject: Re: Xcode 4.3.1 memory usage
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 13 Mar 2012 01:08:03 -0700
> When an application allocates gajillions of little objects, memory usage increases and little objects are scattered all over the heap making it impossible for the system to pull back all of that memory.
The last analysis of this that I saw indicated that fragmentation on dirty pages was actually pretty low, generally. Some apps may be more susceptible to it than others - I could see Safari being that way, for example, thanks to JavaScript.
Apps using the GC might use compaction, too. WebKit does, for example, when built for Lion or later. Xcode 4 uses GC, so it might also have compaction enabled.
GC aside, though, while [last I looked] Mac OS X's default malloc returns memory to the kernel when it becomes completely unused, some performance-oriented malloc implementations don't. tcmalloc, for example, which I believe was (still is?) used by Safari.
It would also be an interesting analysis as to whether the Lion malloc considers VM region population when picking entries from the free lists, or perhaps favours regions with younger allocations, or similar. I doubt it does, because you'd have to prove that you frequently save a significant amount of memory in order for it to be worth the extra complexity and CPU cost. I wonder also if there's a mechanism for marking individual pages within a region as "clean", that it could use.
But I digress. While these are all very interesting academic questions, my experience has generally been that the answer is much more mundane: most memory bloat comes not from outright leaks, but from "abandoned" memory (retain cycles, over-retains, etc) and excessive caching.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden