Giter VIP home page Giter VIP logo

ansjin / memory_leak_detection Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 4.0 88.22 MB

For solving the challenge of online detection of memory leaks in cloud-based infrastructure without having any internal application knowledge we introduce multiple algorithms. The main introduced algorithm is Precog (which works based on ML and uses history information) This algorithms solely use one metric i.e the system's memory utilization on which the application is deployed for the detection of a memory leak. In this work, there are 5 algorithms introduced

License: Apache License 2.0

Python 0.63% Jupyter Notebook 99.37%
memory memory-leak memory-leak-detection cloud-computing online-memory-leak-detection memory-leak-detection-online precog linear-backward-regression

memory_leak_detection's Introduction

Memory Leak Detection Using Trend Analysis

A memory leak in an application deployed on the cloud can affect the availability and reliability of the application. Therefore, to identify and ultimately resolve it quickly is highly important. However, in the production environment running on the cloud, memory leak detection is a challenge without the knowledge of the application or its internal object allocation details.

For solving the challenge of online detection of memory leaks in cloud-based infrastructure without having any internal application knowledge we introduce multiple algorithms. The main introduced algorithm is Precog (which works based on ML and uses history information) This algorithms solely use one metric i.e the system's memory utilization on which the application is deployed for the detection of a memory leak. In this work there are 5 algorithms introduced:

  1. Simple memory leak detection based on Linear Backward Regression.
  2. Based on Polynomial Linear Fitting.
  3. Based on Using Change Points
  4. Precog
  5. Precog Online Version

Read More in our paper: https://link.springer.com/chapter/10.1007/978-3-030-76352-7_21

For other algorithms: https://arxiv.org/abs/2106.08938

Architecture of Precog:

Usecase Example

import sys
sys.path.append('../')
import pandas as pd
from mem_leak_detection import MemLeakDetectionAlgorithm
from mem_leak_detection import MemLeakDetectionAlgorithmPolyFit # based on the linear polynomial fittting on the window
from mem_leak_detection import MemLeakDetectionAlgorithmChangePoints # based on the change point detection
from mem_leak_detection import Precog # introduced Precog algorithm
from mem_leak_detection import PrecogOnline # introduced online version of Precog algorithm

## Get the dataset 
dataset = pd.read_csv('m_1935.csv', names=['timestamp', 'machine_id', 'mem_util_percent', 'label'], skiprows = 1)
dataset['timestamp'] =  pd.to_datetime(dataset['timestamp'])
dataset.set_index('timestamp', inplace=True)

# Run the algorithm
p1 = MemLeakDetectionAlgorithm() # or MemLeakDetectionAlgorithmPolyFit()  # or MemLeakDetectionAlgorithmChangePoints() 
p1 = p1.fit(dataset.mem_util_percent)
p1.predict(dataset.mem_util_percent)

Check Example Python Notebook for more usage details.

Example of Memory leak Detection using linear Polynomial Fitting :

Polynomial Fitting on the sample data

Example of Memory leak Detection using Change points :

Using Change Point Detection on the sample data

Example of Memory leak Detection using Precog :

Using Change Point Detection on the sample data

Example of Memory leak Detection using Precog Onnline : 

Using Change Point Detection on the sample data

Testing the algorithms

(do check the base path in test.py) For testing all the algorithms :

   python3 test.py

Results

[Time 22.08.2019, 12:10], r2 : 0.8

Algorithm:  Backward_Propagation F1-Score:  0.5681818181818182 Time Taken:  97.964118172 TP :  25 FP :  38 TN :  7 FN :  0 TTP :  25 TTN :  45
Algorithm:  Polynomial_Fitting F1-Score:  0.5783132530120482 Time Taken:  92.99911340699998 TP :  24 FP :  34 TN :  11 FN :  1 TTP :  25 TTN :  45
Algorithm:  Change_Points F1-Score:  0.625 Time Taken:  23.922472314999993 TP :  25 FP :  30 TN :  15 FN :  0 TTP :  25 TTN :  45
Algorithm:  PrecogChangePoints_Training_Test_Same F1-Score:  0.6296296296296295 Time Taken:  25.531905480999995 TP :  17 FP :  12 TN :  33 FN :  8 TTP :  25 TTN :  45
Algorithm:  PrecogChangePoints_Training_Test_Same with Max Filtration F1-Score:  0.2758620689655173 Time Taken:  25.482877984999988 TP :  4 FP :  0 TN :  45 FN :  21 TTP :  25 TTN :  45
Algorithm:  Precog_Change_Points F1-Score:  0.6666666666666665 Time Taken:  19.508522030999984 TP :  15 FP :  10 TN :  30 FN :  5 TTP :  20 TTN :  40
Algorithm:  Precog_Change_Points_Max Filtration F1-Score:  0.8571428571428571 Time Taken:  19.517760752000015 TP :  15 FP :  0 TN :  40 FN :  5 TTP :  20 TTN :  40

Reference Our paper:

If you find this code useful in your research, please consider citing:

@InProceedings{10.1007/978-3-030-76352-7_21,
author="Jindal, Anshul
and Staab, Paul
and Cardoso, Jorge
and Gerndt, Michael
and Podolskiy, Vladimir",
editor="Hacid, Hakim
and Outay, Fatma
and Paik, Hye-young
and Alloum, Amira
and Petrocchi, Marinella
and Bouadjenek, Mohamed Reda
and Beheshti, Amin
and Liu, Xumin
and Maaradji, Abderrahmane",
title="Online Memory Leak Detection in the Cloud-Based Infrastructures",
booktitle="Service-Oriented Computing  -- ICSOC 2020 Workshops",
year="2021",
publisher="Springer International Publishing",
address="Cham",
pages="188--200",
abstract="A memory leak in an application deployed on the cloud can affect the availability and reliability of the application. Therefore, to identify and ultimately resolve it quickly is highly important. However, in the production environment running on the cloud, memory leak detection is a challenge without the knowledge of the application or its internal object allocation details.",
isbn="978-3-030-76352-7"
}

@misc{jindal2021memory,
      title={Memory Leak Detection Algorithms in the Cloud-based Infrastructure}, 
      author={Anshul Jindal and Paul Staab and Pooja Kulkarni and Jorge Cardoso and Michael Gerndt and Vladimir Podolskiy},
      year={2021},
      eprint={2106.08938},
      archivePrefix={arXiv},
      primaryClass={cs.DC}
}

Help and Contribution

Please add issues if you have a question or found a problem.

Pull requests are welcome too!

Contributions are most welcome. Please message me if you like the idea and want to contribute.

memory_leak_detection's People

Contributors

ansjin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

memory_leak_detection's Issues

What's the difference between Precog and PrecogOnline?

Hi, thank you for contributing such an awesome work.
I encountered some problems while reading the paper and the code. Would you please explain what's the differen between Precog and PrecogOnline?
Appreciate it very much!

Subject: Request for Assistance

Dear Engineer Anshul,

I hope this message finds you well. My name is Miao Yu, and I am a graduate student from from Zhejiang University nearing the completion of my master's degree. I am reaching out to you as I am in need of some data for my master's thesis, and I believe your expertise in the field would greatly benefit my research.

During my research, I came across references to a dataset located in the "/mnt/datasets/iforesight/metrics/" directory in your code. However, I have been unable to locate this directory or the associated data within the project. I believe that this dataset would greatly contribute to the success and quality of my thesis.

I firmly believe that the data you can provide will have a significant impact on my research and add unique value to my master's thesis.

Thank you very much for considering my request. I genuinely appreciate your time and support. I look forward to your positive response and sincerely hope for your assistance in this matter.
Please feel free to reach me at [email protected]
Thank you once again for your consideration.

Best regards,

Miao Yu

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.