Skip to main content
Glama
JVMind MAT Heap Dump Analyzer

JVMind MAT Heap Dump Analyzer

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MAT_HOMENoDirectory containing plugins/ and configuration/ for Eclipse MAT 1.17.x. Leave empty to auto-detect.
JVMIND_JAVANoPath to the java executable (JDK 21+). Defaults to JAVA_HOME/bin/java or java on PATH.java
JVMIND_MAT_XMXNoJVM heap for MAT parsing and queries, for example 8g. Defaults to 70% of RAM, minimum 4g.8g
JVMIND_DUMP_TIMEOUTNoTimeout for a live heap dump, 1-3600 seconds.300
JVMIND_MCP_DUMP_DIRNoDefault output directory for live heap dumps./tmp/jvmind-mcp-dumps
JVMIND_MCP_STATE_DIRNoDirectory for state, logs, and parsed report registry./tmp/jvmind-mcp-state
JVMIND_DUMP_MIN_FREE_GBNoRefuse to start a dump when free space is below this value.2

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
open_heapdumpA

Open a local Java heap dump (.hprof) by absolute path. Starts MAT indexing in the background and returns a report_id immediately with status=PARSING. Poll get_heapdump_status until DONE. / 按绝对路径打开本地 Java 堆转储(.hprof)。后台启动 MAT 解析并立即返回 report_id 与 status=PARSING,用 get_heapdump_status 轮询直到 DONE。

get_heapdump_statusB

Get parse status and progress for a heap dump report. / 查询堆转储报告的解析状态与进度。

list_heapdumpsA

List heap dumps known to this MCP server with their status. / 列出本 MCP 服务已知的堆转储及其状态。

close_heapdumpA

Release a heap dump handle. Set stop_service=true to also stop the MAT helper process. / 释放堆转储句柄;stop_service=true 时同时停止 MAT 辅助进程。

list_java_processesA

Discover local Java processes that can be attached for a live heap dump. Returns pid, main class, command, and masked JVM arguments. The managed MAT helper is excluded. / 主动发现本机可 attach 的 Java 进程,返回 pid、主类、命令行和已掩码的 JVM 参数;MAT 辅助进程会被排除。

dump_java_heapA

Capture a LIVE heap dump from a running JVM and start MAT parsing. First call with confirm=false (default) to preview the target, output directory, disk space, and timeout; call again with confirm=true to execute. A live dump triggers a Full GC and may pause the target JVM. The dump is written to output_dir (default: current working directory) and is automatically opened for MAT parsing. / 从运行中的 JVM 抓取 live 堆转储并自动开始 MAT 解析。先用默认 confirm=false 预览目标、输出目录、磁盘空间和超时,再用 confirm=true 执行。live dump 会触发 一次 Full GC,可能暂停目标 JVM;默认输出到当前目录。

mat_overviewA

Show heap overview (used/committed/live heap, object/class/classloader counts, JDK version, leak suspect count). Always call this first to understand a heapdump. / 展示堆总览(已用/已提交/存活堆、对象/类/类加载器数量、JDK 版本、泄漏嫌疑数量)。分析 heapdump 时先调用本工具。

mat_histogramB

Class histogram sorted by shallow/retained/count. Top-N by default; pass top to override. objectSet reuses a prior OQL/RS result. / 按 shallow/retained/count 排序的类直方图,默认 Top-20。objectSet 可复用先前 OQL/RS 结果。

mat_dominatorB

Dominator tree: list biggest retained-heap dominators, drill down by passing parent objectId. / 支配树:列出 retained 最大的支配者,传 parent=objectId 可下钻。

mat_threadsA

List threads (name/state/daemon/frameCount), or drill into a thread's stack frames (pass thread=id) or frame locals (pass frame=idx). / 列出线程(名/状态/daemon/帧数),或下钻到某线程的栈帧(传 thread=id)、某帧的局部变量(再传 frame=idx)。

mat_threadlocalsB

Inspect thread locals grouped by valueClass (default) or thread. Useful for finding thread-local leaks. / 按 valueClass(默认)或 thread 分组查看 ThreadLocal,常用于发现 ThreadLocal 泄漏。

mat_objectB

Inspect a single object (class, fields, statics, in/out refs, GC root). Required: object id. / 检查单个对象(类、字段、静态字段、入/出引用、GC Root)。必须传 object id。

mat_path2gcA

Read-only, synchronous lookup of the shortest reference chains from one object to GC roots, explaining why that object is still reachable and not collected. Returns up to five linear paths plus MAT's path tree. Typical flow: get an object id from mat_object, mat_histogram, mat_dominator, or a mat_leak_suspects preferredObjectId, confirm it with mat_object, then call this tool. Use mat_dominator instead when you want to know which object retains an entire subtree; use mat_leak_suspects when you do not yet have a specific object. Requires the report_id of a parsed dump (status=DONE).

mat_oqlB

Run an OQL query against the heap (slow!). Returns rows + a reusable resultSetId. Examples: "SELECT * FROM com.example.Foo s", "SELECT s.id.toString() FROM java.lang.String s". OQL can read arbitrary strings from the heap; handle results as private data. / 执行 OQL 查询(较慢)。返回行和可复用的 resultSetId。示例:SELECT * FROM com.example.Foo s。OQL 可读取堆内任意字符串,注意隐私。

mat_leak_suspectsB

Run LeakHunter (async) — returns leak suspects with retained size and description. SLOW: may take a minute. / 运行 LeakHunter(异步),返回疑似泄漏点及 retained 大小与描述。慢查询,可能耗时数十秒。

mat_diagnose_oomB

Run comprehensive OOM diagnosis (async) combining leak suspects + SQL-in-threads + dominator analysis. / 综合 OOM 诊断(异步),聚合泄漏嫌疑、线程中的 SQL、支配树分析。

mat_connection_poolsB

Diagnose DB connection pools (active/idle counts + leaked connections held > thresholdMs). / 诊断数据库连接池(活跃/空闲数 + 持有超过 thresholdMs 的泄漏连接)。

mat_top_consumersA

Read-only Top Consumers report: biggest individual objects plus retained-size breakdowns by class, class loader, and package. Use this as a quick 'who is using the most memory' overview after mat_overview. Prefer mat_histogram when you need a sortable list of every class with instance counts and shallow/retained sizes, and mat_dominator when you need to walk the object graph downward from a specific parent object. Requires the report_id of a parsed dump (status=DONE).

mat_sql_in_threadsA

Read-only scan of thread stacks for JDBC PreparedStatement objects and SQL strings, used to spot long-running or heavy queries held by threads at OOM time. Requires the report_id of a parsed dump (status=DONE). Results are sorted risky-first, then by the owning thread's retained heap, and include threadId, threadName, threadRetainedBytes, frame, source, objectId, sql, risk (risky|harmless|unknown), and reason. With onlyRisky=true, heartbeat/validation statements such as SELECT 1, SELECT 'x', /* ping */ and VALUES(1) are filtered out; pass onlyRisky=false to see all SQL-like strings.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 19 tools

Disambiguation5/5

Each tool targets a distinct analysis artifact (histogram, dominator tree, top consumers, threads, thread locals, GC paths, OQL, connection pools), and descriptions explicitly cross-reference when to prefer a sibling tool (e.g. mat_histogram vs mat_top_consumers vs mat_dominator, mat_path2gc vs mat_dominator). Composite tools like mat_diagnose_oom are clearly framed as aggregations rather than duplicates.

Naming Consistency4/5

There is a readable two-tier convention: lifecycle tools use plain verb_noun (open_heapdump, get_heapdump_status, list_heapdumps, close_heapdump, dump_java_heap), and analysis tools are uniformly mat_-prefixed. Minor deviations like mat_threadlocals and mat_path2gc (digit abbreviation) break the pattern slightly.

Tool Count4/5

Nineteen tools is on the heavy side of the ideal range, but heap-dump analysis genuinely has many distinct report types plus a lifecycle group (open/status/list/close/live dump/process discovery). Little appears redundant, though a couple of composite tools (mat_diagnose_oom) could arguably be derived from primitives.

Completeness5/5

The surface covers the full lifecycle (discover processes, capture live dumps, open, poll status, list, close) and a broad analysis set (overview, histogram, dominator, top consumers, threads, thread locals, object inspection, GC paths, leak suspects, connection pools, SQL-in-threads, OQL). No obvious dead ends for typical OOM/leak investigations.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues