Merge "Trim reference tables when we trim the heap"