dev1223
dev1223

Reputation: 1159

Memory consumption API

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.

Upvotes: 8

Views: 145

Answers (1)

Joachim Breitner
Joachim Breitner

Reputation: 25763

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.

Upvotes: 8

Related Questions