add the javaUseXcheck option to ServerGame to allow for use of the jni linting/checking system, which spams shitloads of output

This commit is contained in:
DarthArgus
2016-02-19 19:01:21 -06:00
parent d3666f0fa3
commit fe09cb38c1
3 changed files with 17 additions and 6 deletions
@@ -103,6 +103,7 @@ void ConfigServerGame::install(void)
KEY_INT (jediUpdateLocationTimeSeconds, 60 * 5);
KEY_STRING (planetObjectTemplate, "object/planet/planet.iff");
KEY_BOOL (javaConsoleDebugMessages, false);
KEY_BOOL (javaUseXcheck, false);
KEY_BOOL (useVerboseJava, false);
KEY_BOOL (logJavaGc, false);
KEY_INT (javaLocalRefLimit, 16);
@@ -110,6 +110,7 @@ class ConfigServerGame
int universeCheckFrequencySeconds; // how often to scan the resource tree for things that need to be spawned
bool javaConsoleDebugMessages;
bool javaUseXcheck;
bool useVerboseJava;
bool logJavaGc;
int javaLocalRefLimit;
@@ -670,6 +671,7 @@ class ConfigServerGame
static const int getUniverseCheckFrequencySeconds(void);
static const bool getJavaConsoleDebugMessages (void);
static const bool getUseJavaXcheck (void);
static const bool getUseVerboseJava (void);
static const bool getLogJavaGc (void);
@@ -1476,6 +1478,13 @@ inline const bool ConfigServerGame::getJavaConsoleDebugMessages()
//-----------------------------------------------------------------------
inline const bool ConfigServerGame::getUseJavaXcheck()
{
return data->javaUseXcheck;
}
//-----------------------------------------------------------------------
inline const bool ConfigServerGame::getUseVerboseJava(void)
{
return data->useVerboseJava;
@@ -1168,17 +1168,18 @@ void JavaLibrary::initializeJavaThread()
// java 1.8 and higher uses metaspace...which is apparently unlimited by default
#if defined(JNI_VERSION_1_8) || defined(JNI_VERSION_1_9)
tempOption.optionString = "-XX:MetaspaceSize=512m";
tempOption.optionString = "-XX:MetaspaceSize=128m";
options.push_back(tempOption);
#endif
// these don't seem to play nice with java/JNI >= 7
#if !defined(JNI_VERSION_1_9) && !defined(JNI_VERSION_1_8) && !defined(JNI_VERSION_1_7)
tempOption.optionString = "-Xrs";
options.push_back(tempOption);
tempOption.optionString = "-Xcheck:jni";
options.push_back(tempOption);
#endif
if (ConfigServerGame::getUseJavaXcheck())
{
tempOption.optionString = "-Xcheck:jni";
options.push_back(tempOption);
}
if (ConfigServerGame::getCompileScripts())
{