acrlabs / simkube

Record-and-replay Kubernetes simulator based on KWOK
https://appliedcomputing.io/simkube
MIT License
164 stars 7 forks source link

Garbage collection in the tracer #60

Open drmorr0 opened 7 months ago

drmorr0 commented 7 months ago

Description

The tracer component currently never drops anything from memory, which means it will run until it OOMs. This is suboptimal.

We want to implement some sort of (configurable) falling-off time window so that we can actually run the tracer in production without it OOMing. This will require a bit of care and testing to get right, I think. Essentially, I think the algorithm looks something like this:

Every n seconds:

  1. Check to see what tracked objects have been deleted since the last GC run
  2. Remove those objects from the trace, and from the index
  3. Remove any pods that belonged to those objects from the pod owners index

Related: #79