java
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIBM i Java & JVM Monitoring
IBM i Java 与 JVM 监控
Monitor Java Virtual Machines running on IBM i including heap memory, garbage collection, thread counts, and configuration using QSYS2.JVM_INFO.
使用 QSYS2.JVM_INFO 监控运行在 IBM i 上的 Java 虚拟机,包括堆内存、垃圾回收、线程数和配置。
Available Tools
可用工具
The CLI is the primary tool for executing JVM queries. Set to this skill's installed location (the directory containing this SKILL.md file):
ibmiSKILL_DIRbash
undefinedibmiSKILL_DIRbash
undefinedSKILL_DIR = directory containing this SKILL.md
SKILL_DIR = directory containing this SKILL.md
Examples: ./skills/java, ~/.claude/skills/java
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"
undefinedibmi 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"
undefinedService Selection Guide
服务选择指南
JVM Monitoring
JVM 监控
- 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)
- QSYS2.JVM_INFO (VIEW) -- 快速概览所有活动的 JVM
- QSYS2.JVM_INFO (TABLE FUNCTION) -- 提供详细的 JVM 数据,可通过 wait time 参数获取内存明细(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
- 堆使用情况 -- 查看每个 JVM 的当前堆大小、使用中的堆大小和最大堆大小
- 内存明细 -- 通过 table function 获取 malloc、internal、JIT 和 shared class 内存信息
- 阈值警报 -- 查找堆使用百分比超过阈值的 JVM
Performance Monitoring
性能监控
- Garbage Collection -- Total GC time and cycle counts
- Thread Counts -- Java thread count per JVM
- Uptime -- JVM start times for stability tracking
- 垃圾回收 -- GC 总耗时和循环次数
- 线程数 -- 每个 JVM 的 Java 线程数
- 运行时间 -- JVM 启动时间,用于稳定性跟踪
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
- Java Home -- 每个 JVM 使用的 Java 版本
- 用户目录 -- 每个 JVM 的工作目录
- 属性 -- 每个 JVM 已配置属性的数量
- 位模式 -- 识别 32 位或 64 位 JVM
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
- 查找内存消耗较大的 JVM -- 按堆使用量排序,识别资源消耗最高的 JVM
- 检测 GC 压力 -- GC 时间或循环次数过高通常表示存在内存问题
- 容量规划 -- 跟踪各 JVM 的堆增长趋势
- Java 版本审计 -- 识别正在使用的 Java Home
- 排查 OutOfMemoryError -- 查找接近最大堆限制的 JVM
Quick Examples
快速示例
List all active JVMs
列出所有活动的 JVM
bash
ibmi tool list_jvms --tools "$SKILL_DIR/tools/"bash
ibmi tool list_jvms --tools "$SKILL_DIR/tools/"Find JVMs using more than 80% heap
查找堆使用率超过 80% 的 JVM
bash
ibmi tool list_jvms_by_heap_usage --tools "$SKILL_DIR/tools/" --min-heap-pct 80bash
ibmi tool list_jvms_by_heap_usage --tools "$SKILL_DIR/tools/" --min-heap-pct 80Get detailed memory breakdown
获取详细的内存明细
bash
ibmi tool get_jvm_detail --tools "$SKILL_DIR/tools/" --wait-time 10bash
ibmi tool get_jvm_detail --tools "$SKILL_DIR/tools/" --wait-time 10Find JVMs with high GC activity
查找 GC 活动频繁的 JVM
bash
ibmi tool list_jvms_by_gc_activity --tools "$SKILL_DIR/tools/" --min-gc-cycles 100bash
ibmi tool list_jvms_by_gc_activity --tools "$SKILL_DIR/tools/" --min-gc-cycles 100Pre-built Tools
预置工具
The file provides 5 ready-to-use tools:
tools/java.yaml| Tool | Description |
|---|---|
| List all active JVMs with memory and GC stats |
| Detailed JVM info including memory breakdown |
| Find JVMs by heap consumption percentage |
| Find JVMs with highest GC activity |
| JVM configuration and property counts |
bash
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 detailstools/java.yaml| 工具 | 说明 |
|---|---|
| 列出所有活动的 JVM,并显示内存和 GC 统计信息 |
| 获取包括内存明细在内的详细 JVM 信息 |
| 按堆消耗百分比查找 JVM |
| 查找 GC 活动最频繁的 JVM |
| 获取 JVM 配置和属性数量 |
bash
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 detailsReference Documentation
参考文档
- Java Services Catalog -- Available SQL services
- Example SQL Patterns -- Working query examples
- IBM JVM_INFO -- View documentation
- Java 服务目录 -- 可用的 SQL 服务
- 示例 SQL 模式 -- 可直接使用的查询示例
- IBM JVM_INFO -- View 文档