Add /-/chaos/gc endpoint to trigger garbage collector
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
- [-] Changelog entry. This is meant as developer tooling and should probably not be advertised as a feature.
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Related to #297489 (closed)
Edited by Matthias Käppler