pynng icon indicating copy to clipboard operation
pynng copied to clipboard

High CPU usage and memory leak

Open rty813 opened this issue 3 years ago • 2 comments

When I use the pynng module, there will be occasional memory leaks, the available memory will gradually decrease, and the CPU usage will reach more than 120%. Since my program is more complicated, I'm not sure if it's a problem with the pynng module, or something else. So I want to ask, is there any way to troubleshoot?

There are some logcat screenshot.

  1. lsof e06d2d7f99a1fd4d06642fa48749213

  2. strace (9742 is the problematic process) 4ab9b2a9d415eacb7833808b076755b

  3. top -c image

  4. mem_avail 1643342449(1)

rty813 avatar Jan 28 '22 03:01 rty813

Hi @rty813, I think I'm stumbling exactly in the same problem. The fact is that the leak happens very slowly, i.e. I see a very slow drift in memory usage. However, I'm also not sure if it's pynng or some other piece of code.

aqc-carlodri avatar Jan 12 '23 11:01 aqc-carlodri

Hi @rty813, I think I'm stumbling exactly in the same problem. The fact is that the leak happens very slowly, i.e. I see a very slow drift in memory usage. However, I'm also not sure if it's pynng or some other piece of code.

use nng, leak still happend. So, I think it's nng's problem.

rty813 avatar Apr 18 '23 06:04 rty813