[Haskell-cafe] accessing the RTS -M flag value from GHC.RTS.Flags

Adam Flott adam at adamflott.com
Tue Apr 5 20:46:45 UTC 2016


Given,

    import GHC.RTS.Flags

    main = do
        gcf <- getRTSFlags
        print (maxHeapSize (gcFlags gcf))

And running on x86-64 in GHC 7.10.3,

    $ ./ghcflags
    0
    $ ./ghcflags +RTS -M1M
    256
    $ ./ghcflags +RTS -M1024K
    256
    $ ./ghcflags +RTS -M4096K
    1024

Is there anyway I can get access to the value stored in the -M flag
and depend on that value being correct? I was not able find it in the
user's guide or anywhere else for that matter.



Thanks,

Adam



More information about the Haskell-Cafe mailing list