<parent>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
- <version>1.8.3-1.2.0_FJVL</version>
+ <version>1.8.3-1.2.1_FJVL</version>
</parent>
<artifactId>getdown-ant</artifactId>
<parent>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
- <version>1.8.3-1.2.0_FJVL</version>
+ <version>1.8.3-1.2.1_FJVL</version>
</parent>
<artifactId>getdown-core</artifactId>
} catch (NoClassDefFoundError e)
{
// com.sun.management.OperatingSystemMXBean doesn't exist in this JVM
- System.out.println("No com.sun.management.OperatingSystemMXBean");
+ System.err.println(
+ "No com.sun.management.OperatingSystemMXBean: cannot get total physical memory size");
}
// We didn't get a com.sun.management.OperatingSystemMXBean.
return -1;
}
- public static long memPercent(int percent)
+ public static long memPercentAmount(int percent)
{
- return memPercent(percent);
+ return memPercentAmount((float)percent);
}
- public static long memPercent(float percent)
+ public static long memPercentAmount(float percent)
{
- long memPercent = -1;
+ long memPercentAmount = -1;
long physicalMem = getPhysicalMemory();
if (physicalMem > MemorySetting.applicationMinMemory)
{
// try and set at least applicationMinMemory and thereafter ensure
// leaveFreeMinMemory is left for the OS
- memPercent = Math.max(MemorySetting.applicationMinMemory,
- (long) (physicalMem
- - Math.max(physicalMem * (100 - percent) / 100,
- MemorySetting.leaveFreeMinMemory)));
+
+ memPercentAmount = (long) ((physicalMem * percent) / 100F);
+
+ // check for memory left for OS
+ if (physicalMem - memPercentAmount < MemorySetting.leaveFreeMinMemory)
+ {
+ memPercentAmount = physicalMem - MemorySetting.leaveFreeMinMemory;
+ }
+
+ // check for minimum application memsize
+ if (memPercentAmount < MemorySetting.applicationMinMemory)
+ {
+ memPercentAmount = MemorySetting.applicationMinMemory;
+ }
+ } else {
+ // not enough memory for application, just try and grab what we can!
+ memPercentAmount = physicalMem;
}
- return memPercent;
+ return memPercentAmount;
}
}
public final static String maxHeapSizeProperty = "jvmmemmax";
+ protected static boolean logToClassChecked = false;
+
public static long getMemorySetting()
{
return getMemorySetting(null, null);
} catch (NumberFormatException e)
{
memmax = maxHeapSizeDefault;
- System.out.println("MemorySetting Property '" + maxHeapSizeProperty
+ System.out.println("MemorySetting Property '"
+ + maxHeapSizeProperty
+ "' ("
+ jvmmemmaxorig + "') badly formatted, using default ("
+ memmax + ").");
else
{
// no need to warn if no setting
- // System.out.println("MemorySetting Property '" + maxHeapSizeProperty + "' not
+ // System.out.println("MemorySetting Property '" + maxHeapSizeProperty
+ // + "' not
// set.");
}
boolean memoryPercentError = false;
try
{
- pcmem = MemoryPercent.memPercent(percent);
+ pcmem = MemoryPercent.memPercentAmount(percent);
} catch (Throwable t)
{
memoryPercentError = true;
+ "). Likely to be problem with com.sun.management.OperatingSystemMXBean");
t.printStackTrace();
}
- // In the case of an error reading the percentage if physical memory, let's cap maxMemLong to 8GB
+ // In the case of an error reading the percentage of physical memory (when jvmmempc was set), let's cap maxMemLong to 8GB
if (memoryPercentError && jvmmempc != null && pcmem == -1
&& memmax > noMemMaxHeapSizeDefault)
{
<parent>
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
- <version>1.8.3-1.2.0_FJVL</version>
+ <version>1.8.3-1.2.1_FJVL</version>
</parent>
<artifactId>getdown-launcher</artifactId>
if [ x$JVLVERSION != x ]; then
export VERSION=$JVLVERSION
else
- export VERSION=1.8.3-1.2.0_JVL
+ export VERSION=1.8.3-1.2.1_JVL
fi
if [ x${VERSION%_JVL} = x$VERSION ]; then
<groupId>com.threerings.getdown</groupId>
<artifactId>getdown</artifactId>
<packaging>pom</packaging>
- <version>1.8.3-1.2.0_FJVL</version>
+ <version>1.8.3-1.2.1_FJVL</version>
<name>getdown</name>
<description>An application installer and updater.</description>
getdown_txt_title = Jalview
getdown_txt_allow_offline = true
getdown_txt_max_concurrent_downloads = 10
-getdown_txt_jalview.jvmmempc = 90
-getdown_txt_jalview.jvmmemmax = 32G
+# now got better defaults when not set
+getdown_txt_jalview.jvmmempc = 900
+#getdown_txt_jalview.jvmmemmax = 32G # now got better defaults when not set
getdown_txt_multi_jvmarg = -Dgetdownappdir=%APPDIR%
getdown_txt_strict_comments = true
getdown_txt_title = Jalview
} catch (NoClassDefFoundError e)
{
// com.sun.management.OperatingSystemMXBean doesn't exist in this JVM
- System.out.println("No com.sun.management.OperatingSystemMXBean");
+ System.err.println(
+ "No com.sun.management.OperatingSystemMXBean: cannot get total physical memory size");
}
// We didn't get a com.sun.management.OperatingSystemMXBean.
return -1;
}
- public static long memPercent(int percent)
+ public static long memPercentAmount(int percent)
{
- return memPercent(percent);
+ return memPercentAmount((float)percent);
}
- public static long memPercent(float percent)
+ public static long memPercentAmount(float percent)
{
- long memPercent = -1;
+ long memPercentAmount = -1;
long physicalMem = getPhysicalMemory();
if (physicalMem > MemorySetting.applicationMinMemory)
{
// try and set at least applicationMinMemory and thereafter ensure
// leaveFreeMinMemory is left for the OS
- memPercent = Math.max(MemorySetting.applicationMinMemory,
- (long) (physicalMem
- - Math.max(physicalMem * (100 - percent) / 100,
- MemorySetting.leaveFreeMinMemory)));
+
+ memPercentAmount = (long) ((physicalMem * percent) / 100F);
+
+ // check for memory left for OS
+ if (physicalMem - memPercentAmount < MemorySetting.leaveFreeMinMemory)
+ {
+ memPercentAmount = physicalMem - MemorySetting.leaveFreeMinMemory;
+ }
+
+ // check for minimum application memsize
+ if (memPercentAmount < MemorySetting.applicationMinMemory)
+ {
+ memPercentAmount = MemorySetting.applicationMinMemory;
+ }
+ } else {
+ // not enough memory for application, just try and grab what we can!
+ memPercentAmount = physicalMem;
}
- return memPercent;
+ return memPercentAmount;
}
}
public final static String maxHeapSizeProperty = "jvmmemmax";
+ protected static boolean logToClassChecked = false;
+
public static long getMemorySetting()
{
return getMemorySetting(null, null);
} catch (NumberFormatException e)
{
memmax = maxHeapSizeDefault;
- System.out.println("MemorySetting Property '" + maxHeapSizeProperty
+ System.out.println("MemorySetting Property '"
+ + maxHeapSizeProperty
+ "' ("
+ jvmmemmaxorig + "') badly formatted, using default ("
+ memmax + ").");
else
{
// no need to warn if no setting
- // System.out.println("MemorySetting Property '" + maxHeapSizeProperty + "' not
+ // System.out.println("MemorySetting Property '" + maxHeapSizeProperty
+ // + "' not
// set.");
}
boolean memoryPercentError = false;
try
{
- pcmem = MemoryPercent.memPercent(percent);
+ pcmem = MemoryPercent.memPercentAmount(percent);
} catch (Throwable t)
{
memoryPercentError = true;
+ "). Likely to be problem with com.sun.management.OperatingSystemMXBean");
t.printStackTrace();
}
- // In the case of an error reading the percentage if physical memory, let's cap maxMemLong to 8GB
+ // In the case of an error reading the percentage of physical memory (when jvmmempc was set), let's cap maxMemLong to 8GB
if (memoryPercentError && jvmmempc != null && pcmem == -1
&& memmax > noMemMaxHeapSizeDefault)
{