Essential Linux Commands and Java Debugging Tools for Backend Engineers

This article compiles a practical set of Linux command examples and Java debugging utilities—including tail, grep, awk, find, tsar, btrace, Greys, Arthas, JProfiler, and various JVM tools—to help backend developers quickly diagnose and resolve performance and stability issues in production environments.

Top Architect
Top Architect
Top Architect
Essential Linux Commands and Java Debugging Tools for Backend Engineers

The author, a senior architect, shares a curated list of Linux commands and Java debugging tools that are valuable for troubleshooting backend systems.

Linux Command Utilities

Commonly used commands such as tail -300f shopbase.log, various grep patterns, awk scripts, and find options are presented with examples for log inspection, file searching, and directory queries.

System Monitoring Tools

Tools like tsar for historical and real‑time metric collection, and top for process monitoring are demonstrated with command snippets and screenshots.

Java Debugging and Profiling

Several Java‑specific utilities are introduced:

btrace : bytecode injection for tracing method calls and monitoring ArrayList usage.

Greys : class inspection, method tracing, and performance analysis.

Arthas : Alibaba’s open‑source troubleshooting tool.

JProfiler : commercial profiler for deep analysis.

eclipse MAT and zprofiler : heap dump analysis tools.

Sample btrace script:

@OnMethod(clazz = "java.util.ArrayList", method="add", location = @Location(value = Kind.CALL, clazz = "/.*/", method = "/.*/"))
public static void m(@ProbeClassName String probeClass, @ProbeMethodName String probeMethod, @TargetInstance Object instance, @TargetMethodOrField String method) {
    if(getInt(field("java.util.ArrayList", "size"), instance) > 479){
        println("check who ArrayList.add method:" + probeClass + "#" + probeMethod + ", method:" + method + ", size:" + getInt(field("java.util.ArrayList", "size"), instance));
        jstack();
        println();
        println("===========================");
        println();
    }
}

JVM Command Line Tools

Essential commands such as jps, jstack, jinfo, jmap, jstat, and jdb are listed with typical usage examples for process listing, stack tracing, heap inspection, and remote debugging.

Additional Utilities

Tips on using dmesg to detect OOM killer events, VM options for class loading tracing, and methods for resolving jar conflicts (e.g., mvn dependency:tree, -XX:+TraceClassLoading, Greys sc) are also provided.

Overall, the article serves as a handy reference for backend engineers to efficiently diagnose, monitor, and troubleshoot Java applications in production.

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.

debuggingjavaOperationsLinuxtools
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

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.