Improve handling of NaNs in MemoryLogger

Also output number of counted events.
Add additional logging call to log at least two memory consumption measurements