Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in collectionview #10007

Open
pedromcrocha opened this issue Sep 8, 2022 · 5 comments
Open

Memory leak in collectionview #10007

pedromcrocha opened this issue Sep 8, 2022 · 5 comments
Assignees
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView delighter-sc memory-leak 💦 Memory usage grows / objects live forever (sub: perf) migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone

Comments

@pedromcrocha
Copy link

pedromcrocha commented Sep 8, 2022

Description

memory leak when in collectionview the ItemTemplate contains a control with a staticresource

Steps to Reproduce

use public reproduction project repository in android

click several times in test 1, see memory go up until a point

click several times in test 2, see memory go up until a point

click several times in test 3, see memory go up and up, and makes application unrespond

in windows test 2 , see memory go up and up

for test 1 xaml for CollectionView is

    <CollectionView
        x:Name="CollectionView1"
        Grid.Row="3"
        Grid.Column="0" />

for test 2 xaml for CollectionView is

    <CollectionView
        x:Name="CollectionView2"
        Grid.Row="3"
        Grid.Column="1">
        <CollectionView.ItemTemplate>
            <DataTemplate x:DataType="local:DataModel">
                <HorizontalStackLayout>
                    <Label Text="{Binding ID}" />
                    <Label Text="{Binding Name}" />
                    <Label Text="{Binding Data1}" />
                </HorizontalStackLayout>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>

for test 3 xaml for CollectionView is

    <CollectionView
        x:Name="CollectionView3"
        Grid.Row="3"
        Grid.Column="2">
        <CollectionView.ItemTemplate>
            <DataTemplate x:DataType="local:DataModel">
                <HorizontalStackLayout>
                    <Label
                        Background="{StaticResource SecondaryBrush}"
                        Text="{Binding ID}" />
                    <Label Text="{Binding Name}" />
                    <Label Text="{Binding Data1}" />
                </HorizontalStackLayout>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>

Link to public reproduction project repository

https://github.com/pedromcrocha/Maui_MemoryLeak

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows, I was not able test on other platforms

Affected platform versions

android 9/12

Did you find any workaround?

No response

Relevant log output

No response

@pedromcrocha pedromcrocha added the t/bug Something isn't working label Sep 8, 2022
@jsuarezruiz jsuarezruiz added legacy-area-perf Startup / Runtime performance area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows 🪟 platform/android 🤖 labels Sep 9, 2022
@pedromcrocha
Copy link
Author

updated the repository project, to see the count of objects still alive

@hartez hartez added this to the Backlog milestone Sep 15, 2022
@ghost
Copy link

ghost commented Sep 15, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@jsuarezruiz jsuarezruiz self-assigned this Oct 14, 2022
@Zhanglirong-Winnie Zhanglirong-Winnie added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels May 24, 2023
@ghost
Copy link

ghost commented May 25, 2023

Hi @pedromcrocha. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Zhanglirong-Winnie
Copy link

Verified this issue with Visual Studio 17.7.0 Preview 1.0. Not repro on windows and android platform with above project.
Maui_MemoryLeak-master.zip
Windows:
Windows
Android:
Android

@pedromcrocha
Copy link
Author

sorry, but, for what i see in your video, memory and object alive are still growing up.

@ghost ghost removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label May 25, 2023
@samhouts samhouts added the memory-leak 💦 Memory usage grows / objects live forever (sub: perf) label Aug 1, 2023
@rachelkang rachelkang added the migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert label Jan 23, 2024
@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView delighter-sc memory-leak 💦 Memory usage grows / objects live forever (sub: perf) migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 platform/windows 🪟 s/triaged Issue has been reviewed t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

No branches or pull requests

7 participants