All Projects → odnoklassniki → Jvmti Tools

odnoklassniki / Jvmti Tools

Licence: apache-2.0
Collection of small Java serviceability improvements based on JVM Tool Interface

Labels

Projects that are alternatives of or similar to Jvmti Tools

Best Hacking Tools
BEST HACKING TOOLS..For more tools visit our blog for Hackers
Stars: ✭ 46 (-40.26%)
Mutual labels:  tools
Gdbstub
A simple, dependency-free GDB stub that can be easily dropped in to your project.
Stars: ✭ 56 (-27.27%)
Mutual labels:  tools
Encryptlab
A Free and Comprehensive Encrypt and Decrypt Tools Website with example code in Node.js, Website is looking for a new server.
Stars: ✭ 69 (-10.39%)
Mutual labels:  tools
Utils
Docker image with tools like curl, wget, ping, nslookup, dig, psql etc.
Stars: ✭ 49 (-36.36%)
Mutual labels:  tools
Dns Mitm
A minimal DNS service that can provide spoofed replies
Stars: ✭ 54 (-29.87%)
Mutual labels:  tools
Blindfold
🔎 Gitignore file generator written in rust
Stars: ✭ 60 (-22.08%)
Mutual labels:  tools
Jsoncsv
a command tool easily convert json file to csv or xlsx
Stars: ✭ 43 (-44.16%)
Mutual labels:  tools
Infosec Badges
Badges for your GitHub tool presented at InfoSec Conference
Stars: ✭ 74 (-3.9%)
Mutual labels:  tools
Goutil
go util 是golang通用工具包,实现一站式,开箱即用
Stars: ✭ 56 (-27.27%)
Mutual labels:  tools
Circle Generator
Tool to generate circles for block building games like Minecraft
Stars: ✭ 67 (-12.99%)
Mutual labels:  tools
Xjavafxtool
基于JavaFx搭建的实用小工具集合,方便开发过程中的代码编写与调试,想学习javaFx的同学可以参考参考。其中包括文件复制、Cron表达式生成器、编码转换、加密解密、Time转换、路径转换、二维码生成工具、身份证生成器、正则表达式生成工具、网址缩短、转义字符、字符串转换、Mq调试工具、Http调试工具、json格式化编辑工具、图标生成工具、Redis连接工具、网页源码下载工具、切换Hosts工具、Ftp服务器、Cmd调试工具、Ftp/Ftps/Sftp客户端调试工具、Pdf转换工具、文件列表生成器、图片压缩工具、图片转码工具、Kafka调试工具、Email群发工具、颜色代码转换工具、短信群发工具、脚本引擎调试、文件重命名、Json转换、语音转换、Socket调试、图片解析、微信小程序反编译、Zookeeper操作、Excel拆分合并、文件夹监控、文件编码检测、传输、端口扫描、久坐提醒、随机数生成、剪贴板历史、文件搜索、mp3转换、印章生成等工具
Stars: ✭ 1,063 (+1280.52%)
Mutual labels:  tools
Gotools
create some tools use go lang.
Stars: ✭ 54 (-29.87%)
Mutual labels:  tools
Gas Oil Mixture Mobile
Mobile app for calculation of gasoline/oil ratio for 2 stroke engines built with React Native.
Stars: ✭ 61 (-20.78%)
Mutual labels:  tools
Ootbee Support Tools
OOTBee Support Tools addon to extend set of administrative tools on Repository- and Share-tier
Stars: ✭ 46 (-40.26%)
Mutual labels:  tools
Utils
🛠 Lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
Stars: ✭ 1,158 (+1403.9%)
Mutual labels:  tools
Commently
😀💬 Easily comment and update comments on GitHub PRs
Stars: ✭ 45 (-41.56%)
Mutual labels:  tools
Retrobat
RetroBat is the best way to play your ROMs collection on Windows !
Stars: ✭ 58 (-24.68%)
Mutual labels:  tools
Tools To Design Or Visualize Architecture Of Neural Network
Tools to Design or Visualize Architecture of Neural Network
Stars: ✭ 1,143 (+1384.42%)
Mutual labels:  tools
Kalitoolsmanual
Kali Linux 工具合集中文说明书
Stars: ✭ 70 (-9.09%)
Mutual labels:  tools
Bitrix Clear Upload
Скрипт для очистки каталога upload/iblock сайта на CMS 1С-Битрикс от неиспользуемых файлов (оставшихся после удаления элемента инфоблока).
Stars: ✭ 62 (-19.48%)
Mutual labels:  tools

JVM TI tools

Collection of small Java serviceability improvements based on JVM Tool Interface.

richNPE

Enhances NullPointerException thrown by JVM with a detailed error message.

For example, there are several reasons why the following code may throw NullPointerException:

long value = source.map().get(key);

Either

  • source is null, or
  • map() returns null, or
  • get() returns null and the subsequent unboxing fails.

The standard JDK exception message does not give a clue which expression exactly caused NPE, but when using this tool, the message will look like

java.lang.NullPointerException: Called method 'get()' on null object at bci 19

While JDK-8218628 is going to be implemented in JDK 13, the given agent improves NPE messages for existing JDK 8-12.

Compilation

# Linux
g++ -O2 -fPIC -shared -I $JAVA_HOME/include -I $JAVA_HOME/include/linux -olibrichNPE.so richNPE.cpp

# Windows
cl /O2 /LD /I "%JAVA_HOME%/include" -I "%JAVA_HOME%/include/win32" richNPE.cpp

Usage

java -agentpath:/path/to/librichNPE.so MainClass

vmtrace

Traces basic JVM events like

  • Thread started / terminated
  • GC started / finished
  • Class loading / class prepared
  • Method compiled / unloaded
  • Dynamic code generated

Example output

[0.05588] Method compiled: java/lang/String.<init> (1056 bytes)
[0.05597] Loading class: java/io/FileOutputStream$1 (557 bytes)
[0.05600] Class prepared: java/io/FileOutputStream$1
[0.05602] Method compiled: java/lang/String.hashCode (512 bytes)
[0.05618] Thread started: main
[0.05622] Loading class: sun/launcher/LauncherHelper (14692 bytes)
[0.05640] Dynamic code generated: I2C/C2I adapters(0xabbebebea0000000)@0x00000000032c38a0 (392 bytes)
[0.05642] Dynamic code generated: I2C/C2I adapters(0xbebebea0)@0x00000000032c36a0 (376 bytes)
...

Compilation

# Linux
g++ -O2 -fPIC -shared -I $JAVA_HOME/include -I $JAVA_HOME/include/linux -olibvmtrace.so vmtrace.cpp

# Windows
cl /O2 /LD /I "%JAVA_HOME%/include" -I "%JAVA_HOME%/include/win32" vmtrace.cpp

Usage

java -agentpath:/path/to/libvmtrace.so[=output.log] MainClass

The log will be written to the file specified in the agent arguments, or to stderr if no arguments given.

antimodule

Removes Jigsaw restrictions in JDK 9+ by opening and exporting all JDK modules to the unnamed module.

This allows Reflection access to all JDK private fields and methods with no warnings, even when --illegal-access=deny option specified. This also makes all JDK internal classes like sun.nio.ch.DirectBuffer accessible by the unnamed module.

The agent is helpful for running older Java applications on JDK 9+ when application uses private APIs.

Compilation

# Linux
g++ -O2 -fPIC -shared -I $JAVA_HOME/include -I $JAVA_HOME/include/linux -olibantimodule.so antimodule.cpp

# Windows
cl /O2 /LD /I "%JAVA_HOME%/include" -I "%JAVA_HOME%/include/win32" antimodule.cpp

Usage

java -agentpath:/path/to/libantimodule.so MainClass

heapsampler

The example of low-overhead heap allocation profiler based on JEP 331.

Requires JDK 11 or later.

Example output

The output is generated in collapsed stacktraces format suitable for generating Flame Graphs.

Allocate.main;java.lang.Long.valueOf;java.lang.Long 49
Allocate.main;java.lang.Object[] 31
java.lang.Thread.run;jdk.internal.misc.Signal$1.run;java.lang.Terminator$1.handle;java.lang.Class 1
jdk.internal.misc.Signal.dispatch;java.lang.Class 1

See async-profiler for more information about allocation profiling and Flame Graphs. Note that heapsampler works only on JDK 11+, while async-profiler is capable of generating allocation profiles on JDK 7+.

Compilation

# Linux
g++ -O2 -fPIC -shared -I $JAVA_HOME/include -I $JAVA_HOME/include/linux -olibheapsampler.so heapsampler.cpp

# Windows
cl /O2 /LD /I "%JAVA_HOME%/include" -I "%JAVA_HOME%/include/win32" heapsampler.cpp

Usage

java -agentpath:/path/to/libheapsampler.so[=interval] MainClass > output.txt

The agent can be also loaded dynamically in run-time:

jcmd <pid> JVMTI.agent_load /path/to/libheapsampler.so [interval]

The optional interval argument specifies the sampling interval in bytes. The default value is 512 KB. The output is printed on stdout.

faketime

Changes current date/time for a Java application without affecting system date/time.

The agent rebinds the native entry for System.currentTimeMillis and related methods and adds the specified offset to the times returned by these methods.

Compilation

# Linux
g++ -O2 -fPIC -shared -I $JAVA_HOME/include -I $JAVA_HOME/include/linux -olibfaketime.so faketime.cpp

# Windows
cl /O2 /LD /I "%JAVA_HOME%/include" -I "%JAVA_HOME%/include/win32" faketime.cpp

Usage

java -agentpath:/path/to/libfaketime.so=timestamp|+-offset MainClass

where the agent argument is either

  • absolute timestamp in milliseconds from Epoch, or
  • relative offset in milliseconds, if offset starts with + or -

Since System.currentTimeMillis is a JVM intrinsic method, it's also required to disable the corresponding intrinsic to make sure the JNI method is called:

java -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_currentTimeMillis -XX:CompileCommand=dontinline,java.lang.System::currentTimeMillis
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].