Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] Memory Leak when Using Image in Certain Containers  #12733

@LGE-AUGMENSYS

Description

@LGE-AUGMENSYS

Description

When using the Xamarin.Forms Image control to display font glyphs inside a Syncfusion tab view, the entire pages are kept in memory, causing memory leaks.

  • Without the Image control, the leaks are gone;
  • Without the container tab view, the leaks are gone as well in the attached example. However, there are still leaks in our real application. So I'm assuming it also leaks in certain other containers;
  • There are no leaks when downgrading the Xamarin.Forms version to 4.6.

Steps to Reproduce

  1. Launch the attached example app in Visual Studio using the "Memory Usage" performance profiling ;
  2. Click the "Leak Page" button;
  3. Navigate back to the main page;
  4. Gather a snapshot after some GC;
  5. Repeat step 2 & 3 several times (5 in the example screenshots);
  6. Repeat step 4 and make a diff between the two snapshots.

Expected Behavior

No delta in the diff of live instances or at least no additional instances of the LeakPage and its associated instances.

Actual Behavior

Many new instances are kept in memory and cannot be GC'ed. See screenshots below.

Basic Information

  • Version with issue: Xamarin.Forms 4.8.0.1534, 4.8.0.1560, 4.7.0.1351, probably more adjacent minor versions.
  • Last known good version: Xamarin.Forms 4.6.0.1180
  • IDE: Visual Studio 16.7.6
  • Platform Target Frameworks:
    • iOS: haven't tried
    • Android: 10.0 (tried in our real app, not in the attached example)
    • UWP: 19041.508
  • Android Support Library Version: Xamarin.AndroidX.Core 1.3.0.1
  • Nuget Packages: Syncfusion.Xamarin.SfTabView 18.3.0.44
  • Affected Devices: Windows PC, Samsung Galaxy S10

Screenshots

leak_summary
leak_details

Reproduction Link

FormsMemoryLeak.zip

Workaround

Downgrading Xamarin.Forms. However, our product release would be heavily affected by this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions