Created attachment 651429[details]
Proposed fix
At the moment, if atoms are not being collected then every atom is marked in the mark phase so that no atoms will be collected in sweep phase. It's more efficient to neither mark nor sweep the atoms in this case.
Also, we can simplify things by setting the collecting flag of the atoms compartment to record whether atoms are being swept at the start of collection.