Git Product home page Git Product logo

koom's Introduction

license Platform

KOOM

An OOM killer on mobile platform by Kwai.

中文版本请参看这里

Introduction

KOOM creates a mobile high performance online memory monitoring solution,which supplies a detailed report when OOM related problems are detected, and has solved a large number of OOM issues in the Kwai application. It's currently available on Android.

Highlights

High Performance

KOOM blocks the application less than 100ms by forking child process to dump hprof, it also has an efficient leak detect module and a fast hprof analysis module.

High Reliability

KOOM's performance and stability have withstood the test of hundreds of millions of number of users and devices.

Less Code

You just need to init KOOM, and it will take care of other things for you. Advanced custom config is also supported.

Getting started

First look of koom-demo

Try to run the koom-demo project first, and have a general understanding of the functionality provided by KOOM.

Gradle dependencies

dependencies {
    implementation 'com.kwai.koom:java-oom:1.1.0'
}

Quick Tutorial

You can setup KOOM as soon as you want to start memory monitoring, to setup on App startup, you can do like this:

public class KOOMApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        KOOM.init(this);
    }

}

Java-oom Heap Report

Heap dump and analysis is executed automatically.

When the java heap is over the threshold by heap monitor, the heap dump and heap analysis is triggered then.

A java-oom heap report will be generated when heap analysis done.

Find a time to get the report manually.

public void getReportManually() {
    File reportDir = new File(KOOM.getInstance().getReportDir());
    for (File report : reportDir.listFiles()) {
        // Upload the report or do something else.
    }
}

Or set a listener to listen and get the report file status.

public void listenReportGenerateStatus() {
    KOOM.getInstance().setHeapReportUploader(file -> {
        // Upload the report or do something else.
        // File is deleted automatically when callback is done by default.
    });
}

JAVA8 Requirements

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

Custom Feature

See wiki Advanced Custom Feature

Compatibility

See wiki Compatibility

FAQ

See wiki FAQ

Performance

Randomly dump hprof of real users online, and the time consumed by normal dump and for dump blocking users is as follows:

For more detail, please refer to our benchmark.

License

KOOM is under the Apache license 2.0. For details check out the LICENSE.

Change Log

Check out the CHANGELOG.md for details of change history.

Contributing

If you are interested in contributing, check out the CONTRIBUTING.md

Feedback

Welcome report issues or contact us in WeChat group.

koom's People

Contributors

alhah avatar androidinternal avatar awangami 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.