Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak with tonardo #1269

Open
qianyi3210 opened this issue Mar 13, 2019 · 0 comments
Open

memory leak with tonardo #1269

qianyi3210 opened this issue Mar 13, 2019 · 0 comments

Comments

@qianyi3210
Copy link

qianyi3210 commented Mar 13, 2019

my application use pyzmq work with tornado, main work is just like a task center.
The memory will increase into 6G when task is busy, but when i stop task request and after all zmq task finished, the memory only reduce to 3.9g. i use gc.set_debug(DEBUG_LEAK) and find many objects can't be released.
<cell at 0x7fa3b33389f0: weakproxy object at 0x7fa3d88aafc8>,
<cell at 0x7fa3b3338ec0: function object at 0x7fa3d0ac52a8>,
<cell at 0x7fa3b33382f0: function object at 0x7fa3d0ac5aa0>
python:2.7.5
tornado:4.5.2
pyzmq:17.0.0
code as below:

    loop = ZMQIOLoop()
    loop.install()
    context = zmq.Context()
    zmq_publish = context.socket(zmq.PUB)
    zmq_publish.bind("tcp://127.0.0.1:%s" % CommonConstants.ZMQ_PUBLISH_PORT)
    zmq_dispatch = context.socket(zmq.REP)
    zmq_dispatch.bind("tcp://127.0.0.1:%s" % CommonConstants.ZMQ_DISPATCH_PORT)
    zmq_result = context.socket(zmq.PULL)
    zmq_result.bind("tcp://127.0.0.1:%s" % CommonConstants.ZMQ_RESULT_PORT)

    receiver = ZMQStream(zmq_result)
    receiver.on_recv(on_worker_data_in)

    dispatch_stream = ZMQStream(zmq_dispatch)
    dispatch_stream.on_recv(dispatch_recv)
    web.Application([
        (r'/api/v1/sync/(cli|snmp|all)', CommandApiHandler),
           ], autoreload=False).listen(port)
    try:
        ioloop.IOLoop.instance().start()
    except KeyboardInterrupt:
        pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant