Skip to content

Add /-/chaos/gc endpoint to trigger garbage collector

Matthias Käppler requested to merge 297489-trigger-gc-endpoint into master

What does this MR do?

Broken out of !51095 (merged).

For memory measurements, it is often necessary to let memory "settle" to see the impact of a particular change. This requires us to force GC runs so to e.g. tenure objects that are still being referenced. We also hope that this plus the endpoint added to pull system metrics will help to get a more stable baseline for comparisons in performance tests.

Screenshots (strongly suggested)

[10:39:58] work/gl-gck::master ✔ curl -s -XPOST localhost:3000/-/chaos/gc | jq
{
  "worker_id": "puma_1",
  "gc_stat": {
    "count": 94,
    "heap_allocated_pages": 9077,
    "heap_sorted_length": 9077,
    "heap_allocatable_pages": 0,
    "heap_available_slots": 3699720,
    "heap_live_slots": 2827510,
    "heap_free_slots": 872210,
    "heap_final_slots": 0,
    "heap_marked_slots": 2827509,
    "heap_eden_pages": 9077,
    "heap_tomb_pages": 0,
    "total_allocated_pages": 9077,
    "total_freed_pages": 0,
    "total_allocated_objects": 14229357,
    "total_freed_objects": 11401847,
    "malloc_increase_bytes": 8192,
    "malloc_increase_bytes_limit": 30949538,
    "minor_gc_count": 71,
    "major_gc_count": 23,
    "compact_count": 0,
    "remembered_wb_unprotected_objects": 41685,
    "remembered_wb_unprotected_objects_limit": 83370,
    "old_objects": 2617806,
    "old_objects_limit": 5235612,
    "oldmalloc_increase_bytes": 8192,
    "oldmalloc_increase_bytes_limit": 122713697
  }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #297489 (closed)

Edited by Matthias Käppler

Merge request reports