If jstat is deprecated, what should I use instead?
Asked Answered
S

3

5

Suddenly I've found out that jstat is deprecated:

The jstat tool displays performance statistics for an instrumented HotSpot Java virtual machine (JVM). The target JVM is identified by its virtual machine identifier, or vmid option described below.

NOTE: This utility is unsupported and may not be available in future versions of the J2SE SDK. It is not currently available on Windows 98 and Windows ME platforms.

I haven't developed anything on Windows for years, but nevertheless the question is - what should I use instead, which tool (or set of tools) nowadays is considered the best substitute for that kind of monitoring I can get using jstat?

Update: pure CLI tools are preferable.

Samovar answered 3/10, 2012 at 20:31 Comment(0)
B
9

The documentation says that it's unsupported (not quite deprecated yet) since JDK 5 (which you linked), yet it's still present in JDK 6, 7 and OpenJDK 8. I'm not too worried about its disappearance in the short term, especially since it doesn't have a replacement (jcmd doesn't have an equivalent command).

Besides, the tools and utilities directory says it is supported, except on Windows 98 & ME. Then again it says right above that it's unsupported and experimental..


One caveat though: last time I checked, it didn't support G1, but then, neither did JConsole/JVisualVM. It doesn't mean it can't be adapted.

Belovo answered 3/10, 2012 at 20:47 Comment(1)
well, let us hope it won't be removed in nearest future)Samovar
P
3

I think you can go for either VisualVM (or) Jconsole

Both are good tools for JVM monitoring.

Phytopathology answered 3/10, 2012 at 20:32 Comment(2)
No, good if you only have a console (i,e non-windowed) environmentBandeau
@PaulTaylor: Could you be more specific on console environment, I have experience using these only on Windows (and I know these won't work on Unix unless you have some X downloaded on those, is that what you mean)?Phytopathology
F
0

I would recommend Visual VM for Sun JVMs. Get the latest version from SourceForge and install all the plugins. You'll be happy with the visual representation for threads, CPU, memory, etc.

Flume answered 3/10, 2012 at 20:32 Comment(1)
honestly, my work is tightly connected with data visualization, may be this is the reason why I am a huge proponent of CLI tools )))Samovar

© 2022 - 2024 — McMap. All rights reserved.