memory stats need to be thread safe