Skip to content

Memory leak due to removed_stracks #328

@pavelbugneac

Description

@pavelbugneac

Hi!

There seems to be a memory leak coming from removed_stracks.

self.lost_stracks.extend(lost_stracks)
self.lost_stracks = sub_stracks(self.lost_stracks, self.removed_stracks)
self.removed_stracks.extend(removed_stracks)

In bytetrack.py, the self.removed_stracks variable increases without limit. Over time this can lead to running out of RAM memory if we run inference on larger videos or rtsp streams. This also in turn makes tracking inference speed slower over time, since sub_stracks function loops over all elements of self.removed_stracks. There is already an open pr with a suggested solution #249 which ive tested and it works well. Could you either approve or add your own solution to this?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions