java

Installation
SKILL.md

IBM i Java & JVM Monitoring

Monitor Java Virtual Machines running on IBM i including heap memory, garbage collection, thread counts, and configuration using QSYS2.JVM_INFO.

Available Tools

The ibmi CLI is the primary tool for executing JVM queries. Set SKILL_DIR to this skill's installed location (the directory containing this SKILL.md file):

# SKILL_DIR = directory containing this SKILL.md
# Examples: ./skills/java, ~/.claude/skills/java

ibmi tools --tools "$SKILL_DIR/tools/" --toolset java_default
ibmi tool list_jvms --tools "$SKILL_DIR/tools/"
ibmi sql "SELECT JOB_NAME, CURRENT_HEAP_SIZE, IN_USE_HEAP_SIZE FROM QSYS2.JVM_INFO"

Service Selection Guide

JVM Monitoring

  • QSYS2.JVM_INFO (VIEW) -- Quick overview of all active JVMs
  • QSYS2.JVM_INFO (TABLE FUNCTION) -- Detailed JVM data with wait time parameter for memory breakdown (malloc, internal, JIT, shared class)

Key Capabilities

Memory Analysis

  • Heap Usage -- Current, in-use, and maximum heap sizes per JVM
  • Memory Breakdown -- Malloc, internal, JIT, and shared class memory (via table function)
  • Threshold Alerts -- Find JVMs exceeding heap usage percentages

Performance Monitoring

  • Garbage Collection -- Total GC time and cycle counts
  • Thread Counts -- Java thread count per JVM
  • Uptime -- JVM start times for stability tracking

Configuration

  • Java Home -- Which Java version each JVM uses
  • User Directory -- Working directory for each JVM
  • Properties -- Number of configured properties per JVM
  • Bit Mode -- 32-bit vs 64-bit JVM identification

Common Use Cases

  1. Find memory-hungry JVMs -- Sort by heap usage to identify top consumers
  2. Detect GC pressure -- High GC time or cycle count indicates memory issues
  3. Capacity planning -- Track heap growth trends across JVMs
  4. Java version audit -- Identify which Java homes are in use
  5. Troubleshoot OutOfMemoryError -- Find JVMs near max heap

Quick Examples

List all active JVMs

ibmi tool list_jvms --tools "$SKILL_DIR/tools/"

Find JVMs using more than 80% heap

ibmi tool list_jvms_by_heap_usage --tools "$SKILL_DIR/tools/" --min-heap-pct 80

Get detailed memory breakdown

ibmi tool get_jvm_detail --tools "$SKILL_DIR/tools/" --wait-time 10

Find JVMs with high GC activity

ibmi tool list_jvms_by_gc_activity --tools "$SKILL_DIR/tools/" --min-gc-cycles 100

Pre-built Tools

The tools/java.yaml file provides 5 ready-to-use tools:

Tool Description
list_jvms List all active JVMs with memory and GC stats
get_jvm_detail Detailed JVM info including memory breakdown
list_jvms_by_heap_usage Find JVMs by heap consumption percentage
list_jvms_by_gc_activity Find JVMs with highest GC activity
get_jvm_properties JVM configuration and property counts
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/"          # Execute
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" --dry-run # Preview SQL
ibmi tools show <tool_name> --tools "$SKILL_DIR/tools/"     # View details

Reference Documentation

Related skills

More from ajshedivy/ibmi-agent-skills

Installs
2
GitHub Stars
2
First Seen
Apr 1, 2026