mirror of https://github.com/FreeCol/freecol.git
Experimentally boost minimum memory to 1G.
This commit is contained in:
parent
d7d19094e9
commit
3325702a01
|
@ -526,7 +526,7 @@
|
|||
name="FreeCol"
|
||||
mainclass="net.sf.freecol.freecol"
|
||||
version="${freecol.version}"
|
||||
vmoptions="-Xmx512M -Dapple.awt.fakefullscreen=true"
|
||||
vmoptions="-Xmx1G -Dapple.awt.fakefullscreen=true"
|
||||
jvmversion="1.8+"
|
||||
arguments="--windowed --freecol-data FreeCol.app/Contents/Resources/"
|
||||
stubfile="${freecol.build.dir}/skeletons/universalJavaApplicationStub"
|
||||
|
@ -959,7 +959,7 @@
|
|||
<!-- This is a shortcut for NetBeans, and possibly other IDEs. -->
|
||||
<target name="run" depends="package" description="Runs the game">
|
||||
<java jar="FreeCol.jar" fork="true">
|
||||
<jvmarg value="-Xmx512M" />
|
||||
<jvmarg value="-Xmx1G" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<target depends="package" description="Runs the game" name="debug-nb">
|
||||
<nbjpdastart addressproperty="jpda.address" name="FreeCol" transport="dt_socket"/>
|
||||
<java fork="true" jar="FreeCol.jar">
|
||||
<jvmarg value="-Xmx512M"/>
|
||||
<jvmarg value="-Xmx1G"/>
|
||||
<jvmarg value="-Xdebug"/>
|
||||
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
|
||||
</java>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<!-- (more info: http://netbeans.org/kb/articles/freeform-config.html#profilej2se) -->
|
||||
<target depends="-profile-check" description="Runs the game" if="profiler.configured" name="profile-nb">
|
||||
<java fork="true" jar="FreeCol.jar">
|
||||
<jvmarg value="-Xmx512M"/>
|
||||
<jvmarg value="-Xmx1G"/>
|
||||
<jvmarg line="${agent.jvmargs}"/>
|
||||
</java>
|
||||
</target>
|
||||
|
|
|
@ -288,7 +288,7 @@ In order to compile FreeCol you will need Java and
|
|||
\href{http://ant.apache.org/}{the Ant build system}. When these are
|
||||
installed, go to the root directory of FreeCol and type \verb$ant$ to
|
||||
build a JAR file containing the game. The game is started using the
|
||||
command \verb$java -Xmx512M -jar FreeCol.jar$.
|
||||
command \verb$java -Xmx1G -jar FreeCol.jar$.
|
||||
|
||||
If something goes wrong, please open a bug report at the
|
||||
\href{http://sourceforge.net/projects/freecol}{SourceForge page of
|
||||
|
@ -316,7 +316,7 @@ paragraphs.
|
|||
\hypertarget{Command line options}{\subsection{Command line options}}
|
||||
|
||||
If you are in the directory in which FreeCol is installed, you can
|
||||
start the game with the command \verb$java -Xmx512M -jar FreeCol.jar$.
|
||||
start the game with the command \verb$java -Xmx1G -jar FreeCol.jar$.
|
||||
This will tell the Virtual Machine to load the game and to set the
|
||||
maximum heap size to 512 MB. Refer to the manual of your Java Virtual
|
||||
Machine for details.
|
||||
|
|
|
@ -197,7 +197,7 @@ directory of your FreeCol "working copy" in order to compile the game.
|
|||
The file \verb+FreeCol.jar+ will then be generated, and you can start
|
||||
the game simply by running the following command:
|
||||
|
||||
\verb+java -Xmx256M -jar FreeCol.jar+
|
||||
\verb+java -Xmx1G -jar FreeCol.jar+
|
||||
|
||||
Once Ant builds the JAR file, you can rebuild FreeCol as needed any time
|
||||
a modification to the code requires testing. Using Ant to create
|
||||
|
|
|
@ -51,10 +51,10 @@ the directory where you executed the 'ant' command (in case you
|
|||
downloaded the source package).
|
||||
Make sure the file named 'FreeCol.jar' is in your current directory.
|
||||
|
||||
Execute the command 'java -Xmx512M -jar FreeCol.jar'
|
||||
Execute the command 'java -Xmx1G -jar FreeCol.jar'
|
||||
|
||||
Windows users may need to execute
|
||||
'java -Xmx512M -cp . -jar FreeCol.jar'
|
||||
'java -Xmx1G -cp . -jar FreeCol.jar'
|
||||
|
||||
In case the command could not be found, check your Java installation
|
||||
and make sure that the java (*nix) or java.exe (Windows) file is in
|
||||
|
@ -78,7 +78,7 @@ A: Use the command-line option --freecol-data to specify the location
|
|||
|
||||
Q: I am unable to start the game.
|
||||
A: Try running the game in windowed mode:
|
||||
'java -Xmx256M -jar FreeCol.jar --windowed'
|
||||
'java -Xmx1G -jar FreeCol.jar --windowed'
|
||||
|
||||
|
||||
V. Help, Feedback & Bug Reports
|
||||
|
|
|
@ -1 +1 @@
|
|||
java -Xmx512M -Dsun.java2d.d3d=false -jar FreeCol.jar %*
|
||||
java -Xmx1G -Dsun.java2d.d3d=false -jar FreeCol.jar %*
|
||||
|
|
|
@ -79,7 +79,7 @@ fi
|
|||
|
||||
# Clean up the data argument and run.
|
||||
if test "x${FCDAT}" = "xDONTSET!" ; then
|
||||
exec java -Xmx512M -cp "${FCJAR}" net.sf.freecol.FreeCol ${1+"$@"}
|
||||
exec java -Xmx1G -cp "${FCJAR}" net.sf.freecol.FreeCol ${1+"$@"}
|
||||
else
|
||||
exec java -Xmx512M -cp "${FCJAR}" net.sf.freecol.FreeCol --freecol-data "${FCDAT}" ${1+"$@"}
|
||||
exec java -Xmx1G -cp "${FCJAR}" net.sf.freecol.FreeCol --freecol-data "${FCDAT}" ${1+"$@"}
|
||||
fi
|
||||
|
|
|
@ -106,7 +106,8 @@ public final class FreeCol {
|
|||
|
||||
/** The maximum available memory. */
|
||||
private static final long MEMORY_MAX = Runtime.getRuntime().maxMemory();
|
||||
|
||||
private static final long MEGA = 1000000; // Metric
|
||||
|
||||
public static final String CLIENT_THREAD = "FreeColClient:";
|
||||
public static final String SERVER_THREAD = "FreeColServer:";
|
||||
public static final String METASERVER_THREAD = "FreeColMetaServer:";
|
||||
|
@ -131,7 +132,7 @@ public final class FreeCol {
|
|||
public static final float GUI_SCALE_STEP = GUI_SCALE_STEP_PCT / 100.0f;
|
||||
private static final Level LOGLEVEL_DEFAULT = Level.INFO;
|
||||
private static final String JAVA_VERSION_MIN = "1.8";
|
||||
private static final int MEMORY_MIN = 128; // Mbytes
|
||||
private static final long MEMORY_MIN = 512000000; // 512M
|
||||
private static final String META_SERVER_ADDRESS = "meta.freecol.org";
|
||||
private static final int META_SERVER_PORT = 3540;
|
||||
private static final int PORT_DEFAULT = 3541;
|
||||
|
@ -288,10 +289,11 @@ public final class FreeCol {
|
|||
.addName("%version%", JAVA_VERSION)
|
||||
.addName("%minVersion%", JAVA_VERSION_MIN));
|
||||
}
|
||||
if (memoryCheck && MEMORY_MAX < MEMORY_MIN * 1000000) {
|
||||
if (memoryCheck && MEMORY_MAX < MEMORY_MIN) {
|
||||
// Memory message is in Mbytes, hence division by MEGA.
|
||||
fatal(StringTemplate.template("main.memory")
|
||||
.addAmount("%memory%", MEMORY_MAX)
|
||||
.addAmount("%minMemory%", MEMORY_MIN));
|
||||
.addAmount("%minMemory%", MEMORY_MIN / MEGA));
|
||||
}
|
||||
|
||||
// Having parsed the command line args, we know where the user
|
||||
|
@ -886,7 +888,7 @@ public final class FreeCol {
|
|||
*/
|
||||
private static void printUsage(Options options, int status) {
|
||||
HelpFormatter formatter = new HelpFormatter();
|
||||
formatter.printHelp("java -Xmx 256M -jar freecol.jar [OPTIONS]",
|
||||
formatter.printHelp("java -Xmx1G -jar freecol.jar [OPTIONS]",
|
||||
options);
|
||||
System.exit(status);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue