Giter Site home page Giter Site logo

felipebaltazar / xamarin.management.tools Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 19 KB

Tools to track and manage your Xamarin applications

License: MIT License

C# 100.00%
xamarin xamarin-applications android tools management deadlock deadlock-detection memory memory-management memory-leak

xamarin.management.tools's Introduction

Xamarin.Management.Tools

Tools to track and manage your Xamarin applications

NuGet

Getting Started

  • Install the Xamarin.Management.Tools package
Install-Package Xamarin.Management.Tools -Version 1.0.1

SyncContextTracker

Track your application SynchroniationContext to detect deadlocks and potential deadlocks

  • For Xamarin.Forms application
    public partial class App {

        protected override void OnStart() =>
            SyncContextTracker.Start(SyncContextTrackerMode.ReportPotentialDeadlocks);

        protected override void OnSleep() {
        }

        protected override void OnResume() {
        }
    }
  • For Xamarin.Android (without Xamarin.Forms)
    public class MainActivity : AppCompatActivity {
        protected override void OnCreate(Bundle savedInstanceState) {
            base.OnCreate(savedInstanceState);
            SyncContextTracker.Start(SyncContextTrackerMode.ReportPotentialDeadlocks);
        }
    }
  • For Xamarin.IOS (without Xamarin.Forms)
    [Register("AppDelegate")]
    public partial class AppDelegate : FormsApplicationDelegate {
        public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
           SyncContextTracker.Start(SyncContextTrackerMode.ReportPotentialDeadlocks);
           base.FinishedLaunching(app, options);
        }
    }

Dalvik VM (Android)

Track the GRefs on your Android application

    [Application]
    public class MainApplication : Application {
        protected MainApplication(IntPtr javaReference, JniHandleOwnership transfer)
            : base(javaReference, transfer) { }

        public override void OnCreate() {
            base.OnCreate();

            Dalvik.SetupGlobalRefDump();
        }
    }

This will provide a log every 3 seconds, you can also configure a custom interval

    var vm = Dalvik();
    Dalvik.SetupGlobalRefDump(TimeSpan.FromSeconds(5));
    ....

    //Don't forget to discard it
    vm.Dispose();

xamarin.management.tools's People

Contributors

felipebaltazar avatar simix-felipebaltazar avatar

Stargazers

 avatar  avatar

Watchers

 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.