Lisp HUG Maillist Archive

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

 

 

 

Re: Good/clean way to control GC/RAM footprint of app instance?

I have not tried playing around with it, but it looks as if set-gc-parameters allows you to set the maximum buffer size for small objects, and if you set the size for small objects to something larger than anything you generate then all of your objects should be created in that size controlled heap.  I'm just guessing here, since as I stated, I have not tried it.

Good luck,

cooper

Matt.Lamari wrote:

 

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

 

 

 

--- AV & Spam Filtering by M+Guardian - Risk Free Email (TM) ---

-- 
--

If the Arabs (Moslems) put down their weapons today there
would be no more violence. If the Israelis put down their
weapons today there would be no more Israel. (Anonymous)
Updated at: 2020-12-10 08:44 UTC