Why doesn't the ECG show my allocated memory?

After seeing the ECG in 24 days of Hackage , I tried to use it in one of my programs, but it did not show any memory allocations.

So, I tried again with a sample program that just sucks in memory:

{-# LANGUAGE OverloadedStrings #-} module Main where import System.Remote.Monitoring (forkServer) import Control.Applicative ((<$>)) import Control.Monad (foldM, forM_) import Control.Monad.Primitive (PrimMonad, PrimState) import Data.Vector.Mutable (MVector, replicate, read, write, length) import Prelude hiding (read, length, replicate) import Text.Printf accumBy :: (Functor m, PrimMonad m) => (a -> a -> a) -> MVector (PrimState m) a -> ma accumBy fv = do a <- read v 0 foldM (\ai -> do a' <- fa <$> read vi write via' return a' ) a [1 .. length v - 1] main :: IO () main = do forkServer "localhost" 8000 forM_ [1..] $ \n -> do v <- replicate (n*1024) (n :: Int) accumBy (+) v >>= printf "%08x\n" 

The program is working fine

 % ghc --make Temp.hs -rtsopts && ./Temp +RTS -K32mM -RTS 00000400 00001000 00002400 ... 

But the ECG doesn't seem to detect my memory usage at all

EKG stats

What am I doing wrong?

+7
source share
1 answer

To collect statistics you need to use the -T or -T or -S or -S RTS parameter , for example:

 ghc --make Temp.hs -rtsopts && ./Temp +RTS -T -K32mM -RTS 
+11
source

All Articles