Skip to content

connection.send_binary() out of memory #340

@michl2310

Description

@michl2310

Hello,

I encountered a problem when sending binary data through websockets using connection.send_binary().

Example:
datasize is >1MB
connection is slow (using vpn)

while(true) {
connection.send_binary(data);
sleep(100);
}

My guess is that the sending data1 has not completed yet and the new send triggers.
Data2 is being added to a sendbuffer which contains the old data1 and now new data2.
Data1 has been send in the meantime. Send triggers again. Even newer data3 is being added to the buffer.
Now the buffer contains data1, data2 and data3.
In my test the memory has been released only after all sends were completed.
If I used this loop, the sending queue never ends leading to a increasing memory consumption causing out of memory.

Has anyone encountered a similar problem?
What can I do in order to avoid out of memory errors when having slow connections?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions