# Method Debug.gc_status()

Method gc_status

  `mapping(string:int|float) gc_status()`

Description

  Get statistics from the garbage collector.

Returns

  A mapping with the following content will be returned:

  `"num_objects" : int` | Number of arrays, mappings, multisets, objects and programs.
  `"num_allocs" : int` | Number of memory allocations since the last gc run.
  `"alloc_threshold" : int` | Threshold for "num_allocs" when another automatic gc run is scheduled.
  `"projected_garbage" : float` | Estimation of the current amount of garbage.
  `"objects_alloced" : int` | Decaying average over the number of allocated objects between gc runs.
  `"objects_freed" : int` | Decaying average over the number of freed objects in each gc run.
  `"last_garbage_ratio" : float` | Garbage ratio in the last gc run.
  `"non_gc_time" : int` | Decaying average over the interval between gc runs, measured in real time nanoseconds.
  `"gc_time" : int` | Decaying average over the length of the gc runs, measured in real time nanoseconds.

  `"last_garbage_strategy" : string`

  The garbage accumulation goal that the gc aimed for when setting "alloc_threshold" in the last run. The value is either "garbage_ratio_low", "garbage_ratio_high" or "garbage_max_interval". The first two correspond to the gc parameters with the same names in Pike.gc_parameters, and the last is the minimum gc time limit specified through the "min_gc_time_ratio" parameter to Pike.gc_parameters.

  `"last_gc" : int` | Time when the garbage-collector last ran.
  `"total_gc_cpu_time" : int` | The total amount of CPU time that has been consumed in implicit GC runs, in nanoseconds. 0 on systems where Pike lacks support for CPU time measurement.
  `"total_gc_real_time" : int` | The total amount of real time that has been spent in implicit GC runs, in nanoseconds.

See also

  gc(), Pike.gc_parameters(), Pike.implicit_gc_real_time