kaffe problems with -mx option

David Tucker dbtucker at acm.jhu.edu
Sat Nov 21 14:58:04 PST 1998


Hello,

There are a couple problems with the -mx option in Kaffe 1.0.b2:

1.  On the command line, the value should immediately follow the option
without a space, so as to conform with Sun's JVM.

2.  If you specify a value for -mx that is less than 1048576 (which is the
default initial heap size), Kaffe seg faults.  Sun's JVM prints out a nice
error message.

To fix these, you need to modify the function options() in kaffe/kaffe/main.c.
Instead of this:

	else if (strcmp(argv[i], "-mx") == 0) {
		i++;
		if (argv[i] == 0) {
			fprintf(stderr, "Error: No heap size found for -mx option.\n");
			exit(1);
		}
		vmargs.maxHeapSize = parseSize(argv[i]);
	}
 
Do something like this:

	else if (strncmp(argv[i], "-mx", 3) == 0) {
		if (argv[i][3] == 0) {
			fprintf(stderr, "Error: No heap size found for -mx option.\n");       
			exit(1);
		}
		sz = parseSize(&argv[i][3]);
		if (sz < vmargs.allocHeapSize) {
			fprintf(stderr, "Error:  Incompatible initial and maximum heap sizes.\n");
			exit(1);
		}      
		vmargs.maxHeapSize = sz;                
	}

Some other options exhibit the same problems...

Dave




More information about the kaffe mailing list