GithubHelp home page GithubHelp logo

dumper's Introduction

Dumper

Basic java class combined from the following two posts, to allow for the dumping of a .hprof from a running java process:

This class does what a jmap -dump:live,format=b,file=/tmp/jvm.hprof would do, but can work in circumstances where jmap isn't working for some reason.

Configuration

An example of running the class is as follows. This will create a hprof in /tmp/jvm<uuid>.hrpof

su -l userjvmprocess -c "java -classpath /usr/java/default/lib/tools.jar:/tmp/dumpper-0.0.1-SNAPSHOT.jar org.greencheek.jvmtools.HeapDumper <javapid>" -s /bin/bash

To change the file name use the system property -Ddumpfile=/where/you/want.hprof.

su -l userjvmprocess -c "java -Ddumpfile=/tmp/jvm1.hprof -classpath /usr/java/default/lib/tools.jar:/tmp/dumper-0.0.1-SNAPSHOT.jar org.greencheek.jvmtools.HeapDumper 26814" -s /bin/bash

To dump only the live reachable objects in the heap use the system property: -Ddumpliveonly=true

su -l userjvmprocess -c "java -Ddumpfile=/tmp/jvm1.hprof -Ddumpliveonly=true -classpath /usr/java/default/lib/tools.jar:/tmp/dumper-0.0.1-SNAPSHOT.jar org.greencheek.jvmtools.HeapDumper 26814" -s /bin/bash

License

Apache v2, See LICENSE file

dumper's People

Contributors

tootedom avatar

Stargazers

Angus H. avatar

Watchers

Steven 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.