Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memory consumption API

Tags:

haskell

ghc

Is there a way to get total heap consumption (and consumption of specific datatypes) in app runtime (GHC)? I'm writing profiler for my interpreter, so I can't use standard ways.

like image 807
dev1223 Avatar asked Jun 21 '15 16:06

dev1223


Video Answer


1 Answers

You can get the total heap consumption and other stats via getGCStats in module GHC.Stats, at least if you run your program with +RTS -T.

like image 99
Joachim Breitner Avatar answered Oct 12 '22 11:10

Joachim Breitner