The invention relates to a dynamic
memory leak detection method and
system. The method comprises the following steps of: dynamically mounting a memory monitoring module in a dynamic link
library into an
address space of a monitored process by a tool side so as to ensure that the monitored process has a
memory leak detection function; recording
memory operation behaviors by the monitoring module, putting the messages into a
message queue and sending the
message queue to an
proxy server side; and uniformly managing memory information in the
message queue by the
proxy server side and sending the memory information to the tool side. According to the method and
system provided by the invention, the
memory leak conditions in process spaces can be monitored in real time without interrupting target processes, so that real online monitoring is realized; and the
memory leak detection can be remotely controlled through the tool side, and the memory information of the monitored processes can be harmlessly read and written by the
proxy server side, so that practical value is brought to position memory errors and diagnose problems, and the method and
system are suitable for different scenes such as Linux system C / C++ programs,
electric power system programs and the like.