Reduce chunk write queue memory usage (#10873)
Reduce chunk write queue memory usage (#10873)

* dont waste space on the chunkRefMap
* add time factor
* add comments
* better readability
* add instrumentation and more comments
* formatting
* uppercase comments
* Address review feedback. Renamed "free" to "shrink" everywhere, updated comments and threshold to 1000.
* double space

Signed-off-by: Mauro Stettler <7440d3dfac5d7ce1eb11ec47df5ea69143dae2b0@gmail.com>
Co-authored-by: Peter Štibraný <b3f1dc448a22d56c1d25f1a4f29993f19b685343@gmail.com>

Co-authored-by: Mauro Stettler <7440d3dfac5d7ce1eb11ec47df5ea69143dae2b0@gmail.com>
prometheus/prometheus,prometheus/prometheus,prometheus/prometheus,prometheus/prometheus,prometheus/prometheus