Good/clean way to control GC/RAM footprint of app instance?
I may not know enough about the problem at hand to ask the
right questions; but here goes:
On Win32:
Say I have an app that at any instant does not need that
much memory; but it ultimately caps out at a certain amount of RAM, optimally
collecting the right generations so as to keep that stable – but a full
clean-down would get rid of most of that.
Assuming the obvious willingness to give up some CPU, what,
if any, is a good way to control the size of this footprint? I assume that some
pressure is causing the garbage collector to collect certain generations based
upon hitting some limit (as I don’t call it manually) – I would
like to lower that, without having to manually choose times to collect from
code. I do not believe setting the upper limit of memory available to the app
(OS dependent?) achieves this – the runtime then runs out of ram before
collecting.
So, say my app churns along consing like crazy but topping
out at 600 meg of ram – is there a way to sacrifice some cpu and make it
instead hog only 300 megs of ram, without needing to explicitly collect? By
what mechanism should I achieve this?
Thanks,
Matt