java
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
- Find memory-hungry JVMs -- Sort by heap usage to identify top consumers
- Detect GC pressure -- High GC time or cycle count indicates memory issues
- Capacity planning -- Track heap growth trends across JVMs
- Java version audit -- Identify which Java homes are in use
- 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
- Java Services Catalog -- Available SQL services
- Example SQL Patterns -- Working query examples
- IBM JVM_INFO -- View documentation
More from ajshedivy/ibmi-agent-skills
work-management
Query, monitor, and analyze jobs on IBM i using SQL table functions via the ibmi CLI. Use when user asks about: (1) finding jobs by status, user, subsystem, or type, (2) monitoring active job performance (CPU, I/O, memory), (3) detecting long-running SQL statements, (4) analyzing lock contention, (5) checking job queues, (6) scheduled jobs, (7) job logs, (8) replacing WRKACTJOB, WRKUSRJOB, WRKSBSJOB, WRKSBMJOB commands, or (9) any IBM i work management task.
12system-health
Monitor IBM i system health including CPU, memory, disk, ASPs, system limits, and network status via SQL services. Use when user asks about: (1) CPU utilization or system status, (2) memory pool sizes or page faults, (3) disk capacity or ASP usage, (4) system limits approaching thresholds, (5) TCP/IP connections and network status, (6) system activity overview, (7) replacing WRKSYSSTS, WRKDSKSTS, WRKTCPSTS commands, or (8) any system health monitoring task.
4template-skill
Replace with description of the skill and when Claude should use it.
3skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
3ibmi
Core skill for working with IBM i systems via the ibmi CLI and ibmi-mcp-server. Provides text-to-SQL methodology, iterative querying best practices, schema discovery, and SQL validation patterns for Db2 for i. Use as the foundation for ANY IBM i task — install this skill first, then add domain-specific skills (ibmi-database, ibmi-system) as needed.
3performance
Monitor IBM i performance including collection services, temporary storage, disk I/O metrics, and memory pool performance via SQL services. Use when user asks about: (1) collection services configuration or categories, (2) temporary storage usage by bucket or job, (3) disk I/O performance per unit, (4) memory pool page fault rates, (5) performance data collection settings, (6) replacing WRKSYSSTS performance views, or (7) any performance analysis or capacity planning task.
3