Re: confusion about memory fragmentation, vm, and blocks
Re: confusion about memory fragmentation, vm, and blocks
- Subject: Re: confusion about memory fragmentation, vm, and blocks
- From: Mario Emmenlauer <email@hidden>
- Date: Thu, 05 Mar 2009 16:21:24 +0100
Hi,
Dave Keck wrote:
Can I read up details about that pre-allocated space? Is there a good
tutorial or technote?
I understand it is quite a lot VM that my application consumes upon startup,
about 1GB. It seems a fair amount given that I do 3D rendering and whatnot,
but I would still be curious to reduce it. (I've asked about that in
a separate thread (Why is virtual memory so high? (crash)) a while ago,
but have not yet found a definitive conclusion.
Try reading up on virtual memory in general - many of the VM
principles used by Mach aren't Mach-specific. Also, take a look at
Thats what I have done so far, with the funny result that I now know
a lot about abstract VM basics, but completely fail when it comes to
practical issues:-(
One issue, I have read often that there would be alternative malloc
implementations - but I fail to know what good they would do me (or what
bad:-). Also from Shawns reply I learned that due to memory fragmentation,
my application might not be able to reserve the needed memory in one chunk,
but I'm still missing the technique at hand to deal with the problem?
On a side note, I keep reading that it would be good practice not to reserve
many very small blocks but rather one large chunk and re-use that. However,
I fail to understand when this good practice is needed and when not - or
better said, for common practice there should be a sample implementation
that does it for me? Or some technotes on how to implement it?
Same goes for Shawns recommendation with sliding a window over a mmapped
file - it sounds ingenious, but I would rather not write it from scratch
as to avoid errors or performance penalties. Does anyone know an OS library
or implementation I could use?
_Mac OS X Internals_ by Amit Singh - the entire chapter 8 deals with
Mach-specific VM. (I just bought the book a few weeks ago and am very
impressed.)
A very good book, I just bought it this week but haven't really started.
Also, as you optimize your code, bear in mind that the memory figures
for any given app doesn't necessarily reflect the app's complexity.
For example, building a Cocoa app with a single blank window claims
~300 MB virtual memory. My point being, don't lose too much sleep over
why your app is using X memory - it could be perfectly normal.
True, but I'm also keen on finally understanding what this vm-stuff in
my address space does (and if its going to be nice to me or not:-))
Best,
Mario
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden