write out mem stats