Index: /applications/editors/josm/plugins/restart/build.xml
===================================================================
--- /applications/editors/josm/plugins/restart/build.xml	(revision 28437)
+++ /applications/editors/josm/plugins/restart/build.xml	(revision 28438)
@@ -30,5 +30,5 @@
 <project name="restart" default="dist" basedir=".">
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="Commit message"/>
+    <property name="commit.message" value="fix #j5635 -- pass java start options when restarting"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="4980"/>
Index: /applications/editors/josm/plugins/restart/src/josmrestartplugin/RestartJosmAction.java
===================================================================
--- /applications/editors/josm/plugins/restart/src/josmrestartplugin/RestartJosmAction.java	(revision 28437)
+++ /applications/editors/josm/plugins/restart/src/josmrestartplugin/RestartJosmAction.java	(revision 28438)
@@ -6,4 +6,6 @@
 import java.awt.event.KeyEvent;
 import java.io.File;
+import java.lang.management.ManagementFactory;
+import java.util.LinkedList;
 
 import org.openstreetmap.josm.Main;
@@ -28,18 +30,16 @@
         try {
             File jarfile = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI());
-            long memmax = Runtime.getRuntime().maxMemory();
             String javacmd = "java";
             if (Main.platform instanceof PlatformHookWindows) javacmd = "javaw";
-            String[] cmds = new String[] {
-                    javacmd,
-                    "-Xmx" + memmax,
-                    "-jar",
-                    jarfile.getAbsolutePath()
-            };
+            LinkedList<String> cmds = new LinkedList<String>();
+            cmds.add(javacmd);
+            cmds.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments());
+            cmds.add("-jar");
+            cmds.add(jarfile.getAbsolutePath());
             for (String s : cmds)
                 System.out.print(s + " ");
             System.out.println();
 
-            Runtime.getRuntime().exec(cmds);
+            Runtime.getRuntime().exec(cmds.toArray(new String[0]));
         } catch (Exception e) {
             e.printStackTrace();
