The application relates to the technical field of memory detection, in particular to a memory usage tracking method and a storage medium. The method constructs a target
memory block containing a header space and a
data space through obtaining a memory allocation request, records
memory management information in the header space, and hangs the target
memory block to a ring-shaped bidirectional
linked list; in a memory access process, the validity of the target
memory block is checked and
access time information is updated, and safe release is performed according to the
memory management information when releasing; through periodic traversal of the ring-shaped bidirectional
linked list, in combination with the
time information and the reference state of the target memory block, a memory usage tracking result is generated, and
continuous monitoring and abnormal occupation analysis of the memory life cycle are realized. The application realizes
traceability, checkability and analysis of the memory usage state, thereby effectively improving the safety, reliability and problem positioning efficiency of
memory management.