Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2007-05-16 21:15:12 +0000
committerAndrew Niefer2007-05-16 21:15:12 +0000
commitda0c531afabee43a9a32aa11336dd2e16f232847 (patch)
treecb9d7b75cc04ee03da6fd9c0877144d0f371095d /bundles/org.eclipse.equinox.executable/library/eclipse.c
parentc13d04fe5adf1caf39962bbf257df6332aafc00e (diff)
downloadrt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.tar.gz
rt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.tar.xz
rt.equinox.framework-da0c531afabee43a9a32aa11336dd2e16f232847.zip
Diffstat (limited to 'bundles/org.eclipse.equinox.executable/library/eclipse.c')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipse.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipse.c b/bundles/org.eclipse.equinox.executable/library/eclipse.c
index 1e1591e6b..bdd9879c0 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipse.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipse.c
@@ -228,6 +228,9 @@ home directory.");
#define SUPRESSERRORS _T_ECLIPSE("--launcher.suppressErrors")
#define INI _T_ECLIPSE("--launcher.ini")
#define SECOND_THREAD _T_ECLIPSE("--launcher.secondThread")
+#define PERM_GEN _T_ECLIPSE("--launcher.XXMaxPermSize")
+
+#define XXPERMGEN _T_ECLIPSE("-XX:MaxPermSize=")
/* constants for ee options file */
#define EE_EXECUTABLE _T_ECLIPSE("-Dee.executable=")
@@ -250,6 +253,7 @@ static _TCHAR * startupArg = NULL; /* path of the startup.jar the user want
static _TCHAR* vmName = NULL; /* Java VM that the user wants to run */
static _TCHAR* name = NULL; /* program name */
static _TCHAR* library = NULL; /* the shared library */
+static _TCHAR* permGen = NULL; /* perm gen size for sun */
/* variables for ee options */
static _TCHAR* eeExecutable = NULL;
@@ -291,6 +295,7 @@ static Option options[] = {
{ STARTUP, &startupArg, 0, 2 },
{ VM, &vmName, 0, 2 },
{ NAME, &name, 0, 2 },
+ { PERM_GEN, &permGen, 0, 2 },
{ WS, &wsArg, 0, 2 } };
static int optionsSize = (sizeof(options) / sizeof(options[0]));
@@ -656,6 +661,31 @@ static _TCHAR** parseArgList( _TCHAR* data ) {
return execArg;
}
+static void adjustVMArgs( _TCHAR *vm, _TCHAR **vmArgv[] ) {
+ /* Sun VMs need some extra perm gen space */
+ if (isSunVM(vm) && permGen != NULL) {
+ int specified = 0, i = -1;
+
+ /* first check to see if it is already specified */
+ while ( (*vmArgv)[++i] != NULL) {
+ /* we are also counting the number of args here */
+ if (!specified && _tcsncmp((*vmArgv)[i], XXPERMGEN, _tcslen(XXPERMGEN)) == 0) {
+ specified = 1;
+ }
+ }
+
+ if (!specified) {
+ _TCHAR ** oldArgs = *vmArgv;
+ _TCHAR *newArg = malloc((_tcslen(XXPERMGEN) + _tcslen(permGen) + 1) * sizeof(_TCHAR));
+ _stprintf(newArg, _T_ECLIPSE("%s%s"), XXPERMGEN, permGen);
+
+ *vmArgv = malloc((i + 1) * sizeof(_TCHAR *));
+ memcpy(*vmArgv, oldArgs, i * sizeof(_TCHAR *));
+ (*vmArgv)[i] = newArg;
+ (*vmArgv)[i + 1] = 0;
+ }
+ }
+}
/*
* Get the command and arguments to start the Java VM.
*
@@ -681,6 +711,8 @@ static void getVMCommand( int argc, _TCHAR* argv[], _TCHAR **vmArgv[], _TCHAR **
/* If the user specified "-vmargs", add them instead of the default VM args. */
vmArg = (userVMarg != NULL) ? userVMarg : getArgVM( javaVM != NULL ? javaVM : jniLib );
+ adjustVMArgs(javaVM != NULL ? javaVM : jniLib, &vmArg);
+
/* Calculate the number of VM arguments. */
while (vmArg[ nVMarg ] != NULL)
nVMarg++;

Back to the top