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 Leaking and buggy Editor #23838

Closed
TheFrieber opened this issue Jul 25, 2024 · 3 comments
Closed

Memory Leaking and buggy Editor #23838

TheFrieber opened this issue Jul 25, 2024 · 3 comments
Labels
area-controls-editor Editor memory-leak 💦 Memory usage grows / objects live forever (sub: perf) platform/windows 🪟 s/needs-info Issue needs more info from the author s/triaged Issue has been reviewed t/bug Something isn't working

Comments

@TheFrieber
Copy link

TheFrieber commented Jul 25, 2024

Description

I can't exactly reproduce this since i don't know what exactly is causing this. But im sure it's the Editor, because it's also bugging somehow + because the most ram is used by .NET MAUI UI functions:
(Debugged with JetBrains dotMemory, VS2022 only showed the heap i think, whatever it didn't show the unmanaged Memory)
image

Steps to Reproduce

Also the Bug with the Editor, when writing much text, it gets invisible:
Without any changes but currently in Edit Mode:
image

Then Spam a char until it hits the next line:
One char behind:
image
After:
image

Write until the end of the Next line(Until it can't anymore, it'll stop there):
image

Now exit edit mode(If mleak doesn't occour, repeat above steps again WITHOUT CLEARING THE TEXT, add to it instead):
image
Look how the Ram usage goes Rocket.

Code:

[....]                    
                    <Frame Margin="5"
                       Padding="10"
                       BorderColor="Transparent"
                       CornerRadius="15"
                       HorizontalOptions="FillAndExpand"
                       BackgroundColor="{Binding IsUser, Converter={StaticResource BoolToColorConverter}}">
                        <StackLayout>
                            <Label IsVisible="{Binding IsEditing, Converter={StaticResource InverseBoolConverter}}">
                                <Label.FormattedText>
                                    <FormattedString>
                                        <Span Text="{Binding Title}"
                                              Style="{Binding IsUser, Converter={StaticResource UserTitleStyleConverter}}"/>

                                        <Span Text="{Binding Text}"
                                              TextColor="Black"/>
                                    </FormattedString>
                                </Label.FormattedText>
                            </Label>
                            <Editor IsVisible="{Binding IsEditing}"
                               Text="{Binding Text, Mode=TwoWay}"
                               Placeholder="Message"
                               TextColor="OrangeRed"
                               BackgroundColor="LightBlue"
                               Margin="0,0,0,5"/>
                        </StackLayout>
                    </Frame>
[....]

Simple Model, arrows pointing to the vars the Editor/Upcoming code uses:
image

In the ViewModel:

        private bool _isEditing;


        public bool IsEditing
        {
            get => _isEditing;
            set
            {
                if (_isEditing != value)
                {
                    _isEditing = value;
                    OnPropertyChanged();
                }
            }
        }


        public ICommand ToggleEditCommand => new RelayCommand(ToggleEditMode);

And the Simple Event:

        public async void ToggleEditMode()
        {
            IsEditing = !IsEditing;

            if (IsEditing)
            {
                foreach (var message in Messages)
                {
                    message.IsEditing = true;
                }
            }
            else
            {
                foreach (var message in Messages)
                {
                    message.IsEditing = false;
                }
            }
        }

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.6.24327.7

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@TheFrieber TheFrieber added the t/bug Something isn't working label Jul 25, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@samhouts samhouts added area-controls-editor Editor memory-leak 💦 Memory usage grows / objects live forever (sub: perf) labels Aug 27, 2024
@ninachen03
Copy link

Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

@ninachen03 ninachen03 added the s/triaged Issue has been reviewed label Sep 20, 2024
@jfversluis jfversluis added the s/needs-info Issue needs more info from the author label Sep 24, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Sep 30, 2024
@TheFrieber
Copy link
Author

Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

Hello,
thank you for the response. Unfortunately, I already implemented a different way of handling edits in the meantime and therefore I am unable to reproduce this issue from that time. If I encounter the issue again in the future, I will provide more information in a new issue.

Closing the issue now, thanks.

@dotnet-policy-service dotnet-policy-service bot removed the s/no-recent-activity Issue has had no recent activity label Oct 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-editor Editor memory-leak 💦 Memory usage grows / objects live forever (sub: perf) platform/windows 🪟 s/needs-info Issue needs more info from the author s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants