Operations 3 min read

Mastering Arthas: How to Use sc and sm Commands to Inspect JVM Classes and Methods

This article explains the Arthas "sc" (Search‑Class) and "sm" (Search‑Method) commands, showing how they list loaded classes and their methods in a JVM, when they are useful, and why they can often be skipped if source code is available.

FunTester
FunTester
FunTester
Mastering Arthas: How to Use sc and sm Commands to Inspect JVM Classes and Methods
Arthas is an open‑source Java diagnostic tool.

The focus here is on two simple Arthas commands: sc: short for “Search‑Class”, it lists all classes that have already been loaded into the JVM. sm: short for “Search‑Method”, it lists the methods of the loaded classes.

Both commands are primarily for information gathering. In practice they are of limited utility because if you have access to the source code you can directly inspect classes and methods, making these commands almost unnecessary. When source code is unavailable, you can combine them with the jda decompilation command to view the decompiled source of a class.

The article notes that understanding and being aware of sc and sm is sufficient; they are not essential tools for most debugging scenarios.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaJVMdiagnosticsArthassc commandsm command
FunTester
Written by

FunTester

10k followers, 1k articles | completely useless

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.