Giter Site home page Giter Site logo

unomemoryleakexample's Introduction

Uno Memory Leak on iOS

Steps to Reproduce

Run these steps while using the Xamarin Profiler to watch the memory footprint increase linearly as you continue to navigate between the pages.

  1. Run the application on an iOS device from Visual Studio for Mac.
  2. Click the button on the main page of the app to navigate to the secondary page.
  3. Click the button on the secondary page to navigate to the main page.
  4. Repeat steps 2 and 3 ad nauseum (around 20-30 times will increase memory usage to ~30MB).
  5. Stop repeatedly navigating and do nothing for however long you would like.
  6. Take snapshots every 30 seconds or so in the Xamarin Profiler tool and see that the memory footprint remains roughly the same forever.

What's causing the issue?

It's the TextBlock binding to the view model in the SecondaryPage.xaml that causes the view and view model to never be garbage collected. You can see the binding code here.

You can remove the binding and set it to something like

<TextBlock
    HorizontalAlignment="Center"
    FontSize="50"
    Text="This is not bound to the view model." />

and then rerun the Steps to Reproduce listed above and you will see that the memory leak no longer occurs.

unomemoryleakexample's People

Contributors

rc65 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.