Skip to content

memory leak #20

@tweber

Description

@tweber

The server has a memory leak. I found it because my server ran out of memory after several thousand clients connected and disconnected. I verified the leak using Python objgraph pypi.python.org/pypi/objgraph . It appears that for every websocket connection, two generators, one Stream, and one Frame are leaked. Even after the connection is closed, these objects remain in memory. Even after garbage collection. To verify it, add the following two lines to the sample echo server.

    for x in ['generator', 'Stream', 'Frame', 'TextMessage']:
        print x, len(objgraph.by_type(x))

Now connect and disconnect several clients. You will see the number of instances of these objects climb, even after all clients are disconnected, even after garbage collection.

I use geventserver. I have not tried with the other servers. But there is no leakage of Greenlets, so I suspect the issue is not related to gevent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions