The application provides a pointer recycling method,
system and device, the method comprising: scanning
source code or an
abstract syntax tree through a compile-time automatic
instrumentation module, identifying a resource reference entry and a target variable to be managed, inserting a cleanup attribute and ownership transfer
semantics for the target variable, and generating a
resource description table; the resource reference entry comprises a naked pointer; the naked pointer is wrapped using a lightweight proxy structure, and
metadata is associated through the lightweight proxy structure; a resource in the
resource description table is registered, reference count management is performed, cross-function transfer migration is performed, and a unified cleaning operation is performed through a runtime resource manager, to obtain a pointer life cycle state;
system memory occupation information is collected in real time at runtime, memory recycling frequency and strategy are dynamically adjusted according to the memory occupation information, and resource recycling is performed according to the pointer life cycle state. The scheme improves the stability of long-term
system operation, and improves the stability, reliability and development efficiency of C language
software development.