Coder Social home page Coder Social logo

schwindelig / postmortem Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 507 KB

:skull: :fire: :snowflake: A basic analyzer for memory dumps containing managed code

C# 100.00%
crash dump analysis post-mortem crash-dump automated clrmd windbg memory-dump

postmortem's Introduction

PostMortem

A basic analyzer for memory dumps containing managed code. Reports are provided as .md and .html files.

The console app is targeting .net core 2.2, while the PostMorem.Core and PostMorem.Markdown libraries target .net standard 2.0.

The idea and analysing code is heavily inspired (if not just copy-pasted) from the ClrMD project.

Examples

Examples are based on memory dumps generated on the aspnet-crash website

Hang

Worker Processes hanging in Thread.Sleep

Crash

StackOverflowException by recursion and creating thousands of SomeData instances

Memory Leak

Caused by not disposing MemoryStreams and XmlSerializers

Libraries used

Usage

Clone this repository, run dotnet restore and publish it. In the published directory, run

dotnet .\PostMortem.dll

with the following parameters

  -p, --path          Required. Path to the memory dump

  -v, --verbose       (Default: false) Verbose output

  -o, --output-dir    Required. Directory where the results should be saved

  -s, --path2         Path to the second memory dump

  --help              Display this help screen.

  --version           Display version information.

Features

Analysis Report

The analysis report provides the following information:

Runtime Info

  • Pointer Size
  • Heap Count
  • Flag indicating if Server Garbage Collection is in use

Memory Regions

  • Total Size
  • Count
  • Type

Heap Segments

  • Start
  • End
  • Committed End
  • Reserved End
  • Heap
  • Type

Heap Balance

  • Heap
  • Size in Bytes

App Domains

  • Name
  • Loaded Modules

Threads

  • Indication if thread contains exception
  • Information about exception, such as type, message and hresult
  • Stack trace
    • Stack Pointer
    • Instruction Pointer
    • Method Display String

Top Objects

  • Displays top 1000 objects by total size
    • Type
    • Indicator if type directly implements IDisposable
    • Count / number of instances
    • Total size in bytes

Compare Report

PostMortem allows you to compare two memory dumps. See the --help details, on which parameters to use.

Matching Threads

Displays threads where the thread id within both dumps matches.

Matching stack traces are displayed in the table below. A visual indication (:snowflake:) is given when both stack traces seem to be equal.

Object Count Diff

Displays a list of the most common objects, order by the difference in instances between the two dumps.

If a type directly implements IDisposable a visual indication (:warning:) is displayed in the Implements IDisposable column.

postmortem's People

Contributors

schwindelig avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

curioustauseef

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.