ajermakovics / jvm-mon Goto Github PK
View Code? Open in Web Editor NEWConsole-based JVM monitoring tool
Home Page: https://ajermakovics.github.io/jvm-mon/
License: Other
Console-based JVM monitoring tool
Home Page: https://ajermakovics.github.io/jvm-mon/
License: Other
It's a cool tool, any shedule to support jdk 11?
To avoid setting JAVA_HOME
env var before launching
Perhaps using javax.tools.ToolProvider.getSystemToolClassLoader()
http://docs.oracle.com/javase/7/docs/api/javax/tools/ToolProvider.html#getSystemToolClassLoader()
Hi, i have IOException when profiling my app.
Look at screen.
https://ibb.co/hgMx4x
When I try to run a build of HEAD, I get the following:
$ bin/jvm-mon
Exception in thread "main" java.lang.NoClassDefFoundError: sun/jvmstat/monitor/MonitorException
at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:157)
at JvmMon.update(JvmMon.java:38)
at JvmMon.main(JvmMon.java:22)
Caused by: java.lang.ClassNotFoundException: sun.jvmstat.monitor.MonitorException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
$ java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
$ uname -a
Darwin somehost.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
To produce a single executable jar http://www.capsule.io
or maybe Packr https://github.com/libgdx/packr
I would like to be able to kill a java process from the monitor.
Would be great if it would be possible to distribute it using homebrew
Hi, I was curious if there is an option to load the program into a JVM and recieve data and collection to a database or log file? I wrote a pull request a while back and really like the concept.
objc[56636]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java (0x10b6864c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x11333f4e0). One of the two will be used. Which one is undefined.
I like the idea of jvm-mon, but it would be really useful if it displayed/monitored all the java processes running on a box (irrespective of user). If I run jvm-mon as root on my machine (Fedora 23) I would expect to be able to see all java processes running (they are available via jps), but this isn't the case.
Super cool! it's like htop for Java almost :-)
I would recommend having a look at this project:
https://github.com/aragozin/jvm-tools
In particular ttop would be a good drill down per process.
https://github.com/mum4k/termdash
It has some nice features like zooming into a chart.
Currently j2v8 extracts it's native library (libj2v8_linux_x86_64.so) to users home directory.
Should look into extracting it somewhere else, ideally project directory
I'm unable to start the application due to some IOException. There's also warnings related to stack guard:
bin/jvm-mon
OpenJDK 64-Bit Server VM warning: You have loaded library /home/minecraft/jvm-mon-0.3/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
java.io.IOException: well-known file is not secure
at sun.tools.attach.LinuxVirtualMachine.checkPermissions(Native Method)
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:117)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:341)
at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:141)
at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:372)
at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
at JvmMon.update(JvmMon.java:50)
at JvmMon.<init>(JvmMon.java:45)
at JvmMon.main(JvmMon.java:27)
This is on CentOS Linux release 7.4.1708 (Core)
with
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
Dear ajermakovics,
I get a "IndexOutOfBoundsException: Index: 0, Size: 0" on running jvm-mon-0.3/bin/jvm-mon.
./jvm-mon-0.3/bin/jvm-mon
OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/java-monitoring/jvm-mon-0.3/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at JvmMon.(JvmMon.java:46)
at JvmMon.main(JvmMon.java:27)
cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-1~bpo8+1-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
Could you help?
best regards
Would be useful to view JVM process classpath and parameters like VisualVM does it
This maybe a little weird but it's really happening and I don't realize why.
Just launching bin/jvm-mon
with:
java.rmi.ConnectIOException: Exception creating connection to: 192.168.0.150; nested exception is:
java.net.NoRouteToHostException: No route to host (Host unreachable)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:631)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
at com.sun.proxy.$Proxy0.newClient(Unknown Source)
at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2430)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:229)
at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:392)
at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
at JvmMon.update(JvmMon.java:50)
at JvmMon.<init>(JvmMon.java:45)
at JvmMon.main(JvmMon.java:27)
Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 18 more
Interfaces Ip addr:
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether f4:03:43:57:41:6c brd ff:ff:ff:ff:ff:ff
inet 192.168.0.200/24 brd 192.168.0.255 scope global em1
valid_lft forever preferred_lft forever
inet6 fe80::f603:43ff:fe57:416c/64 scope link
valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether f4:03:43:57:41:6d brd ff:ff:ff:ff:ff:ff
4: em3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether f4:03:43:57:41:6e brd ff:ff:ff:ff:ff:ff
5: em4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether f4:03:43:57:41:6f brd ff:ff:ff:ff:ff:ff
Kernel IP routing table
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 em1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
Hello, very nice console app!
Is there a way to monitor remote JVM, i.e over JMX?
I have jvm apps on remote but with JRE only and cant install JDK there
Executing from a VM, unzipped package, CentOS 6
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/rss/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: J2V8 native library not loaded
at com.eclipsesource.v8.V8.checkNativeLibraryLoaded(V8.java:195)
at com.eclipsesource.v8.V8.createV8Runtime(V8.java:149)
at com.eclipsesource.v8.V8.createV8Runtime(V8.java:125)
at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:58)
at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:45)
at JvmMon.<clinit>(JvmMon.java:12)
Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons:
no j2v8_linux_x86_64 in java.library.path
/home/rss/libj2v8_linux_x86_64.so: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /home/rss/libj2v8_linux_x86_64.so)
at com.eclipsesource.v8.LibraryLoader.loadLibrary(LibraryLoader.java:75)
at com.eclipsesource.v8.V8.load(V8.java:71)
at com.eclipsesource.v8.V8.createV8Runtime(V8.java:145)
... 4 more
Hi, during the startup I get the "You have loaded library...." message, then my console is cleared and nothing is shown.
When I CTRL-C, my console is not usable, since there is only 1 line available. On the screenshot there is an OLD line written, then Enter, then NEW written:
Any ideas? I work on Windows, using Cygwin consoles managed by ConEmu 64
Possible hint: I got I working the first time! But since then never again...
I got the following error while running jvm-mon. Not sure if there are logs I can inspect or not.
$ jvm-mon
TypeError: Cannot read property 'Id' of undefined
at renderVmCharts (/usr/local/Cellar/jvm-mon/0.3/libexec/jvm-mon.js:174:25)
at addData (/usr/local/Cellar/jvm-mon/0.3/libexec/jvm-mon.js:150:9)
at Timeout._repeat (/usr/local/Cellar/jvm-mon/0.3/libexec/jvm-mon.js:204:5)
at Timeout.wrapper [as _onTimeout] (timers.js:408:11)
at tryOnTimeout (timers.js:224:11)
at Timer.listOnTimeout (timers.js:198:5)
Hey,
I downloaded your tar, extracted it, did the configuration for Java, and when I executed jvm-mon, here is the error I got :
OpenJDK 64-Bit Server VM warning: You have loaded library /home/tristan/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
node.js:376
callback();
^
module.js:341: Error: Cannot find module '/home/tristan/Téléchargements/jvm-mon-0.1/bin/src/dist/jvm-mon.js'
In the new Go version
So that newly started processes also appear in the list and exited processes disappear.
Atm it only shows processes that were already running.
(base) ➜ jvm-mon git:(master) ✗ ./gradlew npmDeps
Task :npmDeps
npm WARN saveError ENOENT: no such file or directory, open '/Users/develop/jvm-mon/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/develop/jvm-mon/package.json'
npm WARN jvm-mon No description
npm WARN jvm-mon No repository field.
npm WARN jvm-mon No README data
npm WARN jvm-mon No license field.
3 packages are looking for funding
run npm fund
for details
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
(base) ➜ jvm-mon git:(master) ✗ ./build/install/jvm-mon/bin/jvm-mon
java.io.IOException: Management agent not found
at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:365)
at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:141)
at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:372)
at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
at jvmmon.JvmStats.update(JvmStats.kt:32)
at jvmmon.JvmStats.update$default(JvmStats.kt:31)
at jvmmon.JvmStats.(JvmStats.kt:15)
at JvmMon.(JvmMon.kt:12)
at JvmMon$Companion.main(JvmMon.kt:28)
at JvmMon.main(JvmMon.kt)
java.io.IOException: Management agent not found
at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:365)
at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:141)
at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:372)
at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
at jvmmon.JvmStats.update(JvmStats.kt:32)
at jvmmon.JvmStats.update$default(JvmStats.kt:31)
at jvmmon.JvmStats.(JvmStats.kt:15)
at JvmMon.(JvmMon.kt:12)
at JvmMon$Companion.main(JvmMon.kt:28)
at JvmMon.main(JvmMon.kt)
java.io.IOException: Management agent not found
at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:365)
at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:141)
at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:372)
at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
at jvmmon.JvmStats.update(JvmStats.kt:32)
at jvmmon.JvmStats.update$default(JvmStats.kt:31)
at jvmmon.JvmStats.(JvmStats.kt:15)
at JvmMon.(JvmMon.kt:12)
at JvmMon$Companion.main(JvmMon.kt:28)
at JvmMon.main(JvmMon.kt)
node.js:376
callback();
^
/Users/develop/jvm-mon/build/install/jvm-mon/node_modules/marked-terminal/index.cjs:23: SyntaxError: Unexpected token =
(base) ➜ jvm-mon git:(master) ✗ SyntaxError: Unexpected token =
Should be a matter of adding the right J2V8 dependency
$ opt/jvm-mon-0.1/bin/jvm-mon
objc[39393]: Class JavaLaunchHelper is implemented in both /Users/dnw/.jenv/versions/1.8/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
node.js:376
callback();
^
module.js:341: Error: Cannot find module '/Users/dnw/opt/jvm-mon-0.1/bin/src/dist/jvm-mon.js'
$ cd opt/jvm-mon-0.1
$ bin/jvm-mon
objc[39418]: Class JavaLaunchHelper is implemented in both /Users/dnw/.jenv/versions/1.8/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.~
$ # that worked
How can I get plotted values of heap usage graph in text file ( possibly comma separated ) ?
Also, I couldn't understand how exactly are you getting/calculating those values for plotting ? Can you please tell this approach, that would be more beneficial for me.
Thanks in advance, means a lot.
Once memory and cpu chart reaches end it stops updating.
Workaround: switch to another process and back
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.