public class Launcher
{
-
private final static String startClass = "jalview.bin.Jalview";
- private final static int maxHeapSizePerCent = 90;
-
- private final static String maxHeapSizePerCentProperty = "jvmmempc";
-
private final static String dockIconPath = "JalviewLogo_Huge.png";
public static void main(String[] args)
if (!memSet)
{
- long maxMemLong = -1;
- int percent = maxHeapSizePerCent;
- String jvmmempc = System.getProperty(maxHeapSizePerCentProperty);
- try
- {
- if (jvmmempc != null)
- {
- int trypercent = Integer.parseInt(jvmmempc);
- if (0 < trypercent && trypercent <= 100)
- {
- percent = trypercent;
- }
- else
- {
- System.out.println("Property '" + maxHeapSizePerCentProperty
- + "' should be in range 1..100");
- }
- }
- } catch (Exception e)
- {
- System.out.println("Error parsing " + maxHeapSizePerCentProperty
- + " '" + jvmmempc + "'");
- }
-
- try
- {
- maxMemLong = MemorySetting.memPercent(percent);
- } catch (Exception e)
- {
- e.printStackTrace();
- } catch (Throwable t)
- {
- t.printStackTrace();
- }
-
+ long maxMemLong = MemorySetting.getMemorySetting();
+
if (maxMemLong > 0)
{
memSetting = "-Xmx" + Long.toString(maxMemLong);
System.out.println("Running " + startClass + " with "
+ (memSetting == null ? "no memSetting" : memSetting));
+ if (System.getProperty("launcherstop") != null
+ && System.getProperty("launcherstop").equals("true"))
+ {
+ System.exit(0);
+ }
try
{
builder.inheritIO();