The memory released by the query end is recorded in the query mem tracker, main memory in _runtime_state. fix page no cache memory tracking Now the main reason for the inaccurate query memory tracking is that the virtual memory used by the query is sometimes much larger than the actual memory. And the mem hook counts virtual memory.