Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 652
    • Issues 652
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Issues
  • #2698

Closed
Open
Created Nov 07, 2017 by Bitbucket Importer@bitbucket_importerMaintainer

Suspected memory leak with pysnmp==4.4.1 on PyPy 5.9 only (Python seems fine)

Created originally on Bitbucket by initialed85 (Edward Beech)

The code to reproduce is fairly simple- obviously you'll need PyPy 5.9 installed first as well as pysnmp==4.4.1.

#!python

from pysnmp.hlapi import SnmpEngine, UdpTransportTarget, ContextData, ObjectType, ObjectIdentity, getCmd, UsmUserData, usmHMACSHAAuthProtocol, usmAesCfb128Protocol

ITERATIONS = 65536

for i in range(0, ITERATIONS):
    snmp_engine = SnmpEngine()
    context_data = ContextData()

    errorIndication, errorStatus, errorIndex, varBinds = next(
        getCmd(
            snmp_engine,
            UsmUserData(
                userName='some_username',
                authKey='some_auth_key',
                privKey='some_priv_key,
                authProtocol=usmHMACSHAAuthProtocol,
                privProtocol=usmAesCfb128Protocol,
            ),
            UdpTransportTarget(
                ('some_host', 161),
                timeout=5,
                retries=2,
            ),
            context_data,
            ObjectType(ObjectIdentity('.1.3.6.1.2.1.1.5.0'))
        )
    )

    print '{0}/{1} - {2}'.format(i + 1, ITERATIONS, varBinds)

    del snmp_engine
    del context_data

Under PyPy 5.9 memory use steadily increases until (in my experience) MacOS crashes; in Python however, all seems fine.

I've also raised an issue on the PySNMP Github page.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking