Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a Haskell/GHC self-report its GC stats live?

Tags:

haskell

ghc

I'm thinking that having a server to self-report its memory usage would be handy.

I have read the section on memory profiling in the manual, but there are a few drawbacks with this:

  • First this seems to give only post-mortem stats.
  • There is an overhead associated with enabling profiling.
  • I don't really need that much detail.

So that's my question, how can one track the different sets of memory in a running program compiled by GHC?

like image 787
dsign Avatar asked May 11 '15 05:05

dsign


1 Answers

If you integrate ekg into your server, you can access nice graphs and statistics about the runtime and even your own custom metrics via HTTP:

enter image description here

(Image linked from Oliver Charles’ blogpost on ekg)

like image 124
Joachim Breitner Avatar answered Sep 19 '22 18:09

Joachim Breitner