public void Trim() { // Trim indices first to consolidate references before garbage collection _indices.Trim(); // Find any unused values and remove them GarbageCollector.FindUnusedAndCollect(_values, _indicesInner); // Trim values afterward to clean up any newly unused space _values.Trim(); }