This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch feature/CAMEL-23870-heap-histogram
in repository https://gitbox.apache.org/repos/asf/camel.git

commit acf59ede47382c89cf2b5f7ba33a2c7704ba98e2
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jul 1 16:28:13 2026 +0200

    CAMEL-23870: add heap histogram MCP tool for camel ask
    
    Co-Authored-By: Claude <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
 
b/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
index 8c4eace1783a..3f86c4ecd9a6 100644
--- 
a/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
+++ 
b/dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RuntimeTools.java
@@ -317,6 +317,16 @@ public class RuntimeTools {
         return runtimeService.executeAction(p.pid(), "thread-dump", null);
     }
 
+    @Tool(annotations = @Tool.Annotations(readOnlyHint = true, destructiveHint 
= false, openWorldHint = false),
+          description = """
+                  Get a class-level heap histogram showing instance counts and 
byte usage per class. \
+                  Useful for diagnosing memory leaks and understanding which 
classes dominate heap usage.""")
+    public JsonObject camel_runtime_heap_histogram(
+            @ToolArg(description = NAME_OR_PID_DESC) String nameOrPid) {
+        RuntimeService.ProcessInfo p = 
runtimeService.findSingleProcess(nameOrPid);
+        return runtimeService.executeAction(p.pid(), "heap-histogram", null);
+    }
+
     @Tool(annotations = @Tool.Annotations(readOnlyHint = true, destructiveHint 
= false, openWorldHint = false),
           description = """
                   Get the message history trace of the last completed 
exchange. \

Reply via email to