diff --git a/src/core/org/apache/jmeter/gui/action/ActionNames.java b/src/core/org/apache/jmeter/gui/action/ActionNames.java index 6896d5323d..9617f7558a 100644 --- a/src/core/org/apache/jmeter/gui/action/ActionNames.java +++ b/src/core/org/apache/jmeter/gui/action/ActionNames.java @@ -57,6 +57,7 @@ public class ActionNames { public static final String EXPAND_ALL = "expand all"; // $NON-NLS-1$ public static final String FUNCTIONS = "functions"; // $NON-NLS-1$ public static final String HELP = "help"; // $NON-NLS-1$ + public static final String HEAP_DUMP = "heap_dump"; // $NON-NLS-1$ public static final String INSERT_AFTER = "drag_n_drop.insert_after";//$NON-NLS-1$ public static final String INSERT_BEFORE = "drag_n_drop.insert_before";//$NON-NLS-1$ public static final String LAF_PREFIX = "laf:"; // Look and Feel prefix diff --git a/src/core/org/apache/jmeter/gui/action/What.java b/src/core/org/apache/jmeter/gui/action/What.java index db143db8cb..bb9afbd989 100644 --- a/src/core/org/apache/jmeter/gui/action/What.java +++ b/src/core/org/apache/jmeter/gui/action/What.java @@ -23,11 +23,14 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; +import javax.swing.JOptionPane; + import org.apache.jmeter.exceptions.IllegalUserActionException; import org.apache.jmeter.gui.GuiPackage; import org.apache.jmeter.gui.tree.JMeterTreeNode; import org.apache.jmeter.testelement.TestElement; import org.apache.jorphan.logging.LoggingManager; +import org.apache.jorphan.util.HeapDumper; import org.apache.log.Logger; /** @@ -48,6 +51,7 @@ public class What implements Command { commands.add(ActionNames.WHAT_CLASS); commands.add(ActionNames.DEBUG_ON); commands.add(ActionNames.DEBUG_OFF); + commands.add(ActionNames.HEAP_DUMP); commandSet = Collections.unmodifiableSet(commands); } @@ -64,6 +68,13 @@ public class What implements Command { LoggingManager.setPriorityFullName("DEBUG",te.getClass().getName());//$NON-NLS-1$ } else if (ActionNames.DEBUG_OFF.equals(e.getActionCommand())){ LoggingManager.setPriorityFullName("INFO",te.getClass().getName());//$NON-NLS-1$ + } else if (ActionNames.HEAP_DUMP.equals(e.getActionCommand())){ + try { + String s = HeapDumper.dumpHeap(); + JOptionPane.showMessageDialog(null, "Created "+s, "HeapDump", JOptionPane.INFORMATION_MESSAGE); + } catch (Exception ex) { + JOptionPane.showMessageDialog(null, ex.toString(), "HeapDump", JOptionPane.ERROR_MESSAGE); + } } } diff --git a/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java b/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java index 79e510a89a..b76fc7897c 100644 --- a/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java +++ b/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java @@ -253,6 +253,8 @@ public class JMeterMenuBar extends JMenuBar implements LocaleChangeListener { JMenuItem resetDebug = makeMenuItemRes("debug_off", ActionNames.DEBUG_OFF, KeyStrokes.DEBUG_OFF);//$NON-NLS-1$ + JMenuItem heapDump = makeMenuItemRes("heap_dump", ActionNames.HEAP_DUMP);//$NON-NLS-1$ + help_about = makeMenuItemRes("about", 'A', ActionNames.ABOUT); //$NON-NLS-1$ helpMenu.add(contextHelp); @@ -260,6 +262,7 @@ public class JMeterMenuBar extends JMenuBar implements LocaleChangeListener { helpMenu.add(whatClass); helpMenu.add(setDebug); helpMenu.add(resetDebug); + helpMenu.add(heapDump); helpMenu.addSeparator(); helpMenu.add(help_about); } diff --git a/src/core/org/apache/jmeter/resources/messages.properties b/src/core/org/apache/jmeter/resources/messages.properties index f64ebde940..287f8a6201 100644 --- a/src/core/org/apache/jmeter/resources/messages.properties +++ b/src/core/org/apache/jmeter/resources/messages.properties @@ -353,6 +353,7 @@ grouping_no_groups=Do not group samplers grouping_store_first_only=Store 1st sampler of each group only header_manager_title=HTTP Header Manager headers_stored=Headers Stored in the Header Manager +heap_dump=Create a heap dump help=Help help_node=What's this node? html_assertion_file=Write JTidy report to file diff --git a/xdocs/changes.xml b/xdocs/changes.xml index 8971409cf9..a950008426 100644 --- a/xdocs/changes.xml +++ b/xdocs/changes.xml @@ -190,7 +190,7 @@ Cookie Manager has now the default HC3.1 implementation and a new choice HC4 imp
  • 52601 - CTRL + F for the new Find feature
  • 53796 - TestCompiler uses static Set which can grow huge
  • 53673 - Add JMeter version in the jmx file
  • -
  • Add support for HeapDump to the JMeter non-GUI client
  • +
  • Add support for HeapDump to the JMeter non-GUI and GUI client
  • Non-functional changes