ghc-debug-client-0.2.1.0: Useful functions for writing heap analysis tools which use ghc-debug.
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Debug.Fragmentation

Description

Functions for analysing memory fragmentation

Synopsis

Documentation

summariseBlocks :: [RawBlock] -> IO () Source #

Print a summary of the given raw blocks This is useful to see how many MBlocks and how many pinned blocks there are.

censusByMBlock :: [ClosurePtr] -> DebugM (Map BlockPtr CensusStats) Source #

Perform a heap census by which MBlock each closure lives in

censusByBlock :: [ClosurePtr] -> DebugM (Map BlockPtr CensusStats) Source #

Perform a census based on which block each closure resides in.

printBlockCensus :: Map BlockPtr CensusStats -> IO () Source #

Print out a block census

censusPinnedBlocks :: [RawBlock] -> [ClosurePtr] -> DebugM (Map BlockPtr PinnedCensusStats) Source #

Only census the given (pinned) blocks

findBadPtrs :: Map k PinnedCensusStats -> [((Count, [ClosurePtr]), String)] Source #

Given a pinned block census, find the ARR_WORDS objects which are in the blocks which are < 10 % utilised. The return list is sorted by how many times each distinct ARR_WORDS appears on the heap.

histogram :: Word64 -> [CensusStats] -> IO () Source #

Print either a MBlock or Block census as a histogram