throw new IllegalStateException("Memory manager has been shut down.");
}
final Iterator<T> segmentsIterator = segments.iterator();
AbstractInvokable lastOwner = null;
Set<DefaultMemorySegment> segsForOwner = null;
// go over all segments
while (segmentsIterator.hasNext()) {
final MemorySegment seg = segmentsIterator.next();
if (seg.isFreed()) {
continue;
}
final DefaultMemorySegment defSeg = (DefaultMemorySegment) seg;
final AbstractInvokable owner = defSeg.owner;
try {
// get the list of segments by this owner only if it is a different owner than for
// the previous one (or it is the first segment)
if (lastOwner != owner) {