% of memory "unit" to heap-controlling RTS flags

If you're trying to produce ghc executables that will work well without tweaking on machines with different configurations, it would handy to be able to control the heap requested based on the size of physical RAM. For instance, you might want to set -M to 100% or 80% of physical RAM and -H to (say) 25% of physical RAM. I was wondering what people would think if we had a new sort of "unit" for the various memory options that actually specified that the memory amount requested was as a percentage of physical RAM. So you could do something like: prog +RTS -M80% -H25% -RTS to start your heap at 25% of physical RAM and cap it at 80% of of physical RAM. You'd also be able to intermix % with the other memory units so you could do something like: prog +RTS -H256m -M95% -RTS to start your heap at 256m and cap it at 95% of physical RAM. How does that sound? - Ravi

On Mon, Dec 04, 2006 at 01:15:16PM +0300, Bulat Ziganshin wrote:
Monday, December 4, 2006, 4:19:45 AM, you wrote:
and -H to (say) 25% of physical RAM.
i had exactly the same idea. in particular, i want to setup -c value as percentage of available RAM
I've added these suggestions to trac #750: http://hackage.haskell.org/trac/ghc/ticket/750 Thanks Ian
participants (3)
-
Bulat Ziganshin
-
Ian Lynagh
-
Ravi Nanavati