Copyright | (c) The University of Glasgow 1994-2000 |
---|---|
License | see libraries/base/LICENSE |
Maintainer | ghc-devs@haskell.org |
Stability | internal |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides access to internal garbage collection and
memory usage statistics. These statistics are not available unless
a program is run with the -T
RTS flag.
The API of this module is unstable and is tightly coupled to GHC's internals.
If depend on it, make sure to use a tight upper bound, e.g., base < 4.X
rather
than base < 5
, because the interface can change rapidly without much warning.
Since: base-4.5.0.0
Synopsis
- data RTSStats = RTSStats {
- gcs :: Word32
- major_gcs :: Word32
- allocated_bytes :: Word64
- max_live_bytes :: Word64
- max_large_objects_bytes :: Word64
- max_compact_bytes :: Word64
- max_slop_bytes :: Word64
- max_mem_in_use_bytes :: Word64
- cumulative_live_bytes :: Word64
- copied_bytes :: Word64
- par_copied_bytes :: Word64
- cumulative_par_max_copied_bytes :: Word64
- cumulative_par_balanced_copied_bytes :: Word64
- init_cpu_ns :: RtsTime
- init_elapsed_ns :: RtsTime
- mutator_cpu_ns :: RtsTime
- mutator_elapsed_ns :: RtsTime
- gc_cpu_ns :: RtsTime
- gc_elapsed_ns :: RtsTime
- cpu_ns :: RtsTime
- elapsed_ns :: RtsTime
- nonmoving_gc_sync_cpu_ns :: RtsTime
- nonmoving_gc_sync_elapsed_ns :: RtsTime
- nonmoving_gc_sync_max_elapsed_ns :: RtsTime
- nonmoving_gc_cpu_ns :: RtsTime
- nonmoving_gc_elapsed_ns :: RtsTime
- nonmoving_gc_max_elapsed_ns :: RtsTime
- gc :: GCDetails
- data GCDetails = GCDetails {
- gcdetails_gen :: Word32
- gcdetails_threads :: Word32
- gcdetails_allocated_bytes :: Word64
- gcdetails_live_bytes :: Word64
- gcdetails_large_objects_bytes :: Word64
- gcdetails_compact_bytes :: Word64
- gcdetails_slop_bytes :: Word64
- gcdetails_mem_in_use_bytes :: Word64
- gcdetails_copied_bytes :: Word64
- gcdetails_par_max_copied_bytes :: Word64
- gcdetails_par_balanced_copied_bytes :: Word64
- gcdetails_block_fragmentation_bytes :: Word64
- gcdetails_sync_elapsed_ns :: RtsTime
- gcdetails_cpu_ns :: RtsTime
- gcdetails_elapsed_ns :: RtsTime
- gcdetails_nonmoving_gc_sync_cpu_ns :: RtsTime
- gcdetails_nonmoving_gc_sync_elapsed_ns :: RtsTime
- type RtsTime = Int64
- getRTSStats :: IO RTSStats
- getRTSStatsEnabled :: IO Bool
Runtime statistics
Statistics about runtime activity since the start of the
program. This is a mirror of the C struct RTSStats
in RtsAPI.h
Since: base-4.10.0.0
RTSStats | |
|
Instances
Statistics about a single GC. This is a mirror of the C struct
GCDetails
in RtsAPI.h
, with the field prefixed with gc_
to
avoid collisions with RTSStats
.
GCDetails | |
|
Instances
Generic GCDetails | |||||
Defined in GHC.Internal.Stats
| |||||
Read GCDetails | Since: base-4.10.0.0 | ||||
Show GCDetails | Since: base-4.10.0.0 | ||||
type Rep GCDetails | Since: base-4.15.0.0 | ||||
Defined in GHC.Internal.Stats type Rep GCDetails = D1 ('MetaData "GCDetails" "GHC.Internal.Stats" "ghc-internal" 'False) (C1 ('MetaCons "GCDetails" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "gcdetails_gen") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32) :*: S1 ('MetaSel ('Just "gcdetails_threads") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "gcdetails_allocated_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just "gcdetails_live_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "gcdetails_large_objects_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just "gcdetails_compact_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "gcdetails_slop_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just "gcdetails_mem_in_use_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))) :*: (((S1 ('MetaSel ('Just "gcdetails_copied_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just "gcdetails_par_max_copied_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "gcdetails_par_balanced_copied_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just "gcdetails_block_fragmentation_bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "gcdetails_sync_elapsed_ns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RtsTime) :*: S1 ('MetaSel ('Just "gcdetails_cpu_ns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RtsTime)) :*: (S1 ('MetaSel ('Just "gcdetails_elapsed_ns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RtsTime) :*: (S1 ('MetaSel ('Just "gcdetails_nonmoving_gc_sync_cpu_ns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RtsTime) :*: S1 ('MetaSel ('Just "gcdetails_nonmoving_gc_sync_elapsed_ns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RtsTime))))))) |
getRTSStats :: IO RTSStats Source #
Get current runtime system statistics.
Since: base-4.10.0.0
getRTSStatsEnabled :: IO Bool Source #
Returns whether GC stats have been enabled (with +RTS -T
, for example).
Since: base-4.10.0.0