简体   繁体   中英

Virtual memory size increasing in a program C++

I have a program which is working perfectly fine. But it works fine for 5-6 days after that it gets killed SIGKILL . When I observed that memory was the issue, I did strict deallocation wherever allocation is done.

I am using linux top command for monitoring the memory usage.

As of now the program is working fine. But, slowly the VIRT virtual memory attribute in top command is increasing slowly. Why is that so? I am deallocating stuff everywhere it is needed.

Thanks in advance. :)

If you are developing on Linux, compile your application with g++ -Wall -g , improve it till no warnings are given, and use gdb and valgrind to debug the memory leaks.

You might be perhaps interested in using Boehm's conservative garbage collector .

Read also about memory fragmentation .

You may check any memory mismanagement with valgrind

Try to run the application for a while and check any possible memory problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM