Re: [Gc] P.S. Should I be enabling unmapping?
ivmai at mail.ru
Mon Dec 14 22:25:11 PST 2009
"Talbot, George" <Gtalbot at ansarisbio.com> wrote:
> On the subject of the last post I made, I've been enabling the garbage collector to unmap pages it's not using as it's very helpful in top & ps to be able to see how much address space my program's using. Being able to force GC_collect() as the last e-mail shows is a useful thing in that context.
> For an ostensibly reliable application, should I bother with allowing the garbage collector to unmap pages?
Depends on your application (if the app might need a lot of memory during only some part of time it is working then it ight be good to turn on unmapping). But unmapping adds more complexity to GC implementation (and there bugs could still exist). Also, you should know this is not a real unmapping, so if a some moment OS couldn't map the page again because there's no more virtual memory space available then you would get mmap failure instead of trying to do garbage collection. (But I don't think this is why you got that failure.)
> Is it a bad idea to be able to call GC_collect() as a debugging tool? I.e. can I force the collector to fail with GC_collect() when it otherwise wouldn't have failed?
I think this should be ok unless you're calling it being inside a GC func or inside GC_call_with_alloc_lock.
> George T. Talbot
> <gtalbot at locuspharma.com>
More information about the Gc