lextudio / pysnmp

Python SNMP library
https://www.pysnmp.com/pysnmp/
BSD 2-Clause "Simplified" License
78 stars 19 forks source link

pyasn1 decoder.decode causing memory leak #70

Closed heisenberg-7 closed 4 months ago

heisenberg-7 commented 4 months ago

Expected behavior

Memory should remain constant when SNMP v3 traps are coming continuously, even if Pysnmp create objects that are heavy they should be deleted and memory should be freed once each trap processing is done.

Actual behavior

when SNMP V3 traps are continuously received at a microservice after some time or maybe a specific number of trapf, memory start increasing and it increasing till it reaches app limit (docker limit)

memory here is checked from docker stats command

Detailed steps

https://stackoverflow.com/questions/78500917/pyasn-decoder-decode-causing-memory-leak-as-docker-stats-show-continuous-memory

Python package information

pysnmp=4.4.12, pyasn1=0.4.8

Operating system information

Linux

Python information

python 3.8

(Optional) Contents of your test script

No response

Relevant log output

No response

heisenberg-7 commented 4 months ago

Any help is appreciated...

Thanks

lextm commented 4 months ago

This repo does not cover those old versions of Python packages. So, close this one as invalid.

heisenberg-7 commented 4 months ago

@lextm seeing issue with pysnmp-lextudio==6.1.2, pyasn1==0.6.0 and pyasn1-modules==0.4.0 as well.

Design is like below: When trap is received (v3) decoding it using pyasn1 decoder.decode to get SecurityEngineId then some processing on that and passed on to pysnmp for further decoding/validations.

lextm commented 4 months ago

Only if you can reproduce this with latest pysnmp-lextudio and pyasn1 on Python 3.12, the discussion might be useful to others.

heisenberg-7 commented 4 months ago

Only if you can reproduce this with latest pysnmp-lextudio and pyasn1 on Python 3.12, the discussion might be useful to others.

Python is 3.8