--- a/NEWS Wed Mar 04 21:09:02 2020 +0100
+++ b/NEWS Fri Mar 06 20:18:21 2020 +0100
@@ -76,6 +76,10 @@
* Support more brackets: \<llangle> \<rrangle> (intended for implicit argument syntax).
+* Action isabelle.jconsole (menu item Plugins / Isabelle / Java/VM
+Monitor) applies the jconsole tool on the running Isabelle/jEdit
+process. This allows to monitor resource usage etc.
+
*** Isabelle/VSCode Prover IDE ***
--- a/src/Pure/System/isabelle_system.scala Wed Mar 04 21:09:02 2020 +0100
+++ b/src/Pure/System/isabelle_system.scala Fri Mar 06 20:18:21 2020 +0100
@@ -317,6 +317,9 @@
result(progress_stdout, progress_stderr, progress_limit, strict)
}
+ def jconsole(): Process_Result =
+ bash("isabelle_jdk jconsole " + java.lang.ProcessHandle.current().pid).check
+
private lazy val gnutar_check: Boolean =
try { bash("tar --version").check.out.containsSlice("GNU tar") || error("") }
catch { case ERROR(_) => false }
--- a/src/Tools/jEdit/src/Isabelle.props Wed Mar 04 21:09:02 2020 +0100
+++ b/src/Tools/jEdit/src/Isabelle.props Fri Mar 06 20:18:21 2020 +0100
@@ -34,6 +34,7 @@
isabelle-session-browser \
isabelle.preview \
isabelle.draft \
+ isabelle.jconsole \
- \
isabelle-debugger \
isabelle-documentation \
--- a/src/Tools/jEdit/src/actions.xml Wed Mar 04 21:09:02 2020 +0100
+++ b/src/Tools/jEdit/src/actions.xml Fri Mar 06 20:18:21 2020 +0100
@@ -212,4 +212,9 @@
isabelle.jedit.Keymap_Merge.check_dialog(view);
</CODE>
</ACTION>
+ <ACTION NAME="isabelle.jconsole">
+ <CODE>
+ isabelle.jedit.Isabelle.jconsole(view);
+ </CODE>
+ </ACTION>
</ACTIONS>
--- a/src/Tools/jEdit/src/isabelle.scala Wed Mar 04 21:09:02 2020 +0100
+++ b/src/Tools/jEdit/src/isabelle.scala Fri Mar 06 20:18:21 2020 +0100
@@ -581,4 +581,19 @@
val range = Text.Range(caret_range.start, view.getBuffer.getLength)
goto_error(view, range, avoid_range = caret_range, which = "next ")(_.headOption)
}
+
+
+ /* jconsole */
+
+ def jconsole(view: View) {
+ Future.thread(name = "jconsole", daemon = true) {
+ try { Isabelle_System.jconsole() }
+ catch {
+ case exn: Throwable =>
+ GUI_Thread.later {
+ GUI.error_dialog(view, "System error", GUI.scrollable_text(Exn.message(exn)))
+ }
+ }
+ }
+ }
}
--- a/src/Tools/jEdit/src/jEdit.props Wed Mar 04 21:09:02 2020 +0100
+++ b/src/Tools/jEdit/src/jEdit.props Fri Mar 06 20:18:21 2020 +0100
@@ -231,6 +231,7 @@
isabelle.increase-font-size.shortcut=C+PLUS
isabelle.increase-font-size2.label=Increase font size (clone)
isabelle.increase-font-size2.shortcut=C+EQUALS
+isabelle.jconsole.label=Java/VM Monitor
isabelle.last-error.label=Go to last error
isabelle.last-error.shortcut=CS+z
isabelle.message.label=Show message