Code Monkey home page Code Monkey logo

jvm-tools's Introduction

Swiss Java Knife

SJK is a command line tool for JVM diagnostic, troubleshooting and profiling.

SJK exploits standard diagnostic interfaces of JVM (such as JMX, JVM attach and perf counters) and add some more logic on top to be useful for common troubleshooting case.

Prebuild binaries are available at bintray.com (download) are below. I would encourge you to build jars from sources, though.

Starting sjk

java -jar sjk.jar <cmd> <arguments>
java -jar sjk.jar --help
java -jar sjk.jar --help <cmd>

Below a few command from SJK (full command reference).

Pools thread CPU usage of target JVM and periodically report to console.

  • Could sort thread by CPU usage and/or thread's name.
  • Could limit number of thread displayed
  • Display thread memory allocation rate and cumulative process allocation rate (if supported by JVM)

More details

Similar to jps.

  • Plus could filter process java processes by their system properties.
  • Plus could display specific system properties of process in output.
  • Plus could display values of specific -XX for HotSpot JVM processes.

More details

Similar to jmap -histo.

  • Plus can show histogram of dead objects (histograms of all and live requested, then difference is calculated).
  • Plus can show N top buckets in histogram.

More details

Report information about GC in real time. Data is retrieved via JMX.

More details

These commands provide basic sample profiler capabilities. stcap produces hyper-dense stack trace dump (about 1000 compression rate compared to text format) and ssa provides few basic reports over dump files.

So far following reports are available

  • stack frame histogram with advanced filtering options
  • converting dump to text format

Dump file can be also processed programatically.

This command allow you to do basic operations with MBean from command line.

It can

  • read MBean attributes
  • update MBean writeable attributes
  • invoke MBean operations (arguments are supported)
  • displays composite and tabular data in human readable format
  • use wild cards to shorten MBean names (e.g. *:*,name=CodeCacheManager instead of java.lang:type=MemoryManager,name=CodeCacheManager)
  • connect to local JVM processes by PID (e.i. any Java process, you do not need to enable JMX server)
  • connect to JMX using host:port (password authentication is supported)

More details

mxdump

Dumps all MBeans of target java process to JSON.

jvm-tools's People

Contributors

aragozin avatar orthographic-pedant avatar loverdos avatar deverton avatar ivannik avatar tomekp 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.