-/* src/vm/finalizer.c - finalizer linked list and thread
+/* src/vm/vm.c - VM startup and shutdown functions
Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
Changes: Martin Platter
- $Id: finalizer.c 4357 2006-01-22 23:33:38Z twisti $
+ $Id: vm.c 4357 2006-01-22 23:33:38Z twisti $
*/
/* define heap sizes **********************************************************/
-#define HEAP_MAXSIZE 64 * 1024 * 1024 /* default 64MB */
-#define HEAP_STARTSIZE 2 * 1024 * 1024 /* default 2MB */
-#define STACK_SIZE 128 * 1024 /* default 128kB */
+#define HEAP_MAXSIZE 128 * 1024 * 1024 /* default 128MB */
+#define HEAP_STARTSIZE 2 * 1024 * 1024 /* default 2MB */
+#define STACK_SIZE 64 * 1024 /* default 64kB */
/* define command line options ************************************************/
puts(" value is appended to the bootstrap class path");
puts(" -Xbootclasspath/p:<zip/jar files and directories separated by :>");
puts(" value is prepended to the bootstrap class path");
- puts(" -Xms<size> set the initial size of the heap (default: 2MB)");
- puts(" -Xmx<size> set the maximum size of the heap (default: 64MB)");
- puts(" -Xss<size> set the thread stack size (default: 128kB)");
+ printf(" -Xms<size> set the initial size of the heap (default: %dMB)\n", HEAP_STARTSIZE / 1024 / 1024);
+ printf(" -Xmx<size> set the maximum size of the heap (default: %dMB)\n", HEAP_MAXSIZE / 1024 / 1024);
+ printf(" -Xss<size> set the thread stack size (default: %dkB)\n", STACK_SIZE / 1024);
puts(" -Xprof[:bb] collect and print profiling data");
#if defined(ENABLE_JVMTI)
/* -Xdebug option depend on gnu classpath JDWP options. options:
#endif
puts(" CFLAGS : "VERSION_CFLAGS"\n");
- puts("Default classpath variables:\n");
- puts(" java.boot.class.path : "CACAO_VM_ZIP_PATH":"CLASSPATH_GLIBJ_ZIP_PATH"");
- puts(" java.library.path : "CLASSPATH_LIBRARY_PATH"\n");
-
- puts("Runtime classpath variables:\n");
- printf(" java.boot.class.path : %s\n", bootclasspath);
+ puts("Default variables:\n");
+ printf(" maximum heap size : %d\n", HEAP_MAXSIZE);
+ printf(" initial heap size : %d\n", HEAP_STARTSIZE);
+ printf(" stack size : %d\n", STACK_SIZE);
+ puts(" java.boot.class.path: "CACAO_VM_ZIP_PATH":"CLASSPATH_GLIBJ_ZIP_PATH"");
+ puts(" java.library.path : "CLASSPATH_LIBRARY_PATH"\n");
+
+ puts("Runtime variables:\n");
+ printf(" maximum heap size : %d\n", opt_heapmaxsize);
+ printf(" initial heap size : %d\n", opt_heapstartsize);
+ printf(" stack size : %d\n", opt_stacksize);
+ printf(" java.boot.class.path: %s\n", bootclasspath);
}
{
char *cp;
s4 cplen;
- u4 heapmaxsize;
- u4 heapstartsize;
s4 opt;
s4 i, j, k;
checknull = false;
opt_noieee = false;
- heapmaxsize = HEAP_MAXSIZE;
- heapstartsize = HEAP_STARTSIZE;
- opt_stacksize = STACK_SIZE;
+ opt_heapmaxsize = HEAP_MAXSIZE;
+ opt_heapstartsize = HEAP_STARTSIZE;
+ opt_stacksize = STACK_SIZE;
#if defined(ENABLE_JVMTI)
j = atoi(opt_arg);
if (opt == OPT_MX)
- heapmaxsize = j;
+ opt_heapmaxsize = j;
else if (opt == OPT_MS)
- heapstartsize = j;
+ opt_heapstartsize = j;
else
opt_stacksize = j;
}
#if defined(ENABLE_JVMTI)
if (jvmti) {
- set_jvmti_phase(JVMTI_PHASE_ONLOAD);
- agentload(agentarg, agentbypath, &handle, &libname);
+ jvmti_set_phase(JVMTI_PHASE_ONLOAD);
+ jvmti_agentload(agentarg, agentbypath, &handle, &libname);
}
- set_jvmti_phase(JVMTI_PHASE_PRIMORDIAL);
+ jvmti_set_phase(JVMTI_PHASE_PRIMORDIAL);
#endif
/* initialize the garbage collector */
- gc_init(heapmaxsize, heapstartsize);
+ gc_init(opt_heapmaxsize, opt_heapstartsize);
#if defined(ENABLE_INTRP)
/* Allocate main thread stack on the Java heap. */
assert(class_java_lang_System->state & CLASS_LOADED);
#if defined(ENABLE_JVMTI)
- set_jvmti_phase(JVMTI_PHASE_DEAD);
- if (jvmti) agentunload();
+ if (jvmti || (dbgcom!=NULL)) {
+ jvmti_set_phase(JVMTI_PHASE_DEAD);
+ if (jvmti) jvmti_agentunload();
+ }
#endif
if (!link_class(class_java_lang_System))