codypiersall / pynng

Python bindings for Nanomsg Next Generation.
https://pynng.readthedocs.io
MIT License
260 stars 58 forks source link

High CPU usage and memory leak #99

Open rty813 opened 2 years ago

rty813 commented 2 years ago

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)

aqc-carlodri commented 1 year ago

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.

rty813 commented 1 year ago

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.