Skip to content

Memory leaks on some widgets #2849

@freakboy3742

Description

@freakboy3742

Describe the bug

Some widgets are known to cause memory leaks when used on some platforms. In most cases, this is likely due to the inadvertent introduction of circular references between native libraries and the CPython runtime.

Steps to reproduce

#2088 added testbed tests for memory cleanup of widgets (the factory-generated test_cleanup on each widget).

Any test_cleanup that is has an xfail_platforms argument indicates the platforms where a leak is known to exist.

Expected behavior

No widgets should need the xfail_platforms argument in the testbed tests.

Screenshots

No response

Environment

  • Operating System: iOS and Android have the most problems; some problems on Linux and Windows.
  • Python version: All
  • Software versions:
    • Briefcase: 0.3.19+
    • Toga: 0.4.6+
    • ...

Logs


Additional context

Invoking gc.get_referents() and gc.get_referrers() before asserting ref() is None in the cleanup test method is one way to identify the reference cycles that exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.gtkThe issue relates to GTK supportlinuxThe issue relates Linux support.windowsThe issue relates to Microsoft Windows support.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions