correct memory usage tracking