Skip to content

Leaked Channels #109

@Lankester

Description

@Lankester

My application joins and leaves different channels depending on where the user is in the application.

During some profiling tests I noticed some leaked objects, that appeared to be generated following calls to channel.leave(). Originally I assumed it was my code but in the end I managed to find the following in the memory debugger which seems to indicate an orphaned channel, several closure contexts, and cyclic references to PhxTimer and Push. Essentially the channel is never deallocated and however many channels the application joins they always persist in memory.

memory_graph

I have managed to solve the issue with the following changes Lankester@0c5c263 but despite the tests passing I am not sure it is the best way.

If it turns out to be a reasonable solution, I'd be happy to submit a PR.

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