add memory usage stats

also make it possible to turn off timeseries recording.