简体   繁体   中英

Memory leaking and embedded linux

I am running my own c++ program in embedded linux. At first VSZ is ~6000kB (top) but after 1h VSZ is increased ~100kB. In the program there is two threads. Both threads take tcp and ssl connections almost all the time. I have run same program in depian linux with valgrind. Valgrind didn't find any errors. I didn't find a way how to compile valgrind to that embedded linux. Is it possible that valgrind doesn't find all the error from threads? Can you help me somehow?

You should not jump into the conclusion that your program is "leaking memory" just because the VSZ increased after a while. This is normal especially that the program is accepting network connections. I recoomend this:

1 - If you are using busybox's "top", install procps and use its "top". It gives better info regarding memory status.

2 - Monitor the stack used by each thread. The satck can grow over time and will reflect in the VSZ.

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