[Jamvm-general] [jamvm-general] Consider adding support for specifying memory in gigabyes via -msNg
Brought to you by:
rlougher
From: Mark D. D. <mad...@gm...> - 2011-09-26 08:29:24
|
Hi! While using jamvm for icedtea, I noticed that some of my java apps were failing terribly. After a grand time googling around for what could have been causing the problems, I noticed that my java environment did not accept memory heap arguments in terms of gigabytes. That is, while for other java vms the following would have worked: java -Xmx1g -jar foo.jar Under jam I kept getting: Invalid maximum heap size: -Xmx1g (min 4K) Could not create the Java virtual machine. It wasn't easy to google, but I noticed that size in gigabytes was accepted by other vms, but not jam. On the other hand, jam would happily accept size in megabytes even in excess of 1024. I looked into the source of the jamvm from icedtea below: http://icedtea.classpath.org/download/drops/jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa.tar.gz and added the following lines to get it to accept gigabyte arguments. === +diff -Nru jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa.orig/src/init.c jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa/src/init.c +--- jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa.orig/src/init.c 2011-03-25 17:36:12.000000000 +0800 ++++ jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa/src/init.c 2011-06-16 01:44:48.879998232 +0800 +@@ -123,6 +123,11 @@ + case '\0': + break; + ++ case 'G': ++ case 'g': ++ n *= GB; ++ break; ++ + case 'M': + case 'm': + n *= MB; +diff -Nru jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa.orig/src/jam.h jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa/src/jam.h +--- jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa.orig/src/jam.h 2011-03-25 17:36:12.000000000 +0800 ++++ jamvm-a95ca049d3bb257d730535a5d5ec3f73a943d0aa/src/jam.h 2011-06-16 01:42:30.688998249 +0800 +@@ -734,6 +734,7 @@ + + #define KB 1024 + #define MB (KB*KB) ++#define GB (MB*KB) + + /* minimum allowable size of object heap */ + #define MIN_HEAP 4*KB === I haven't researched very well whether this is already part of upstream or not, as I only took this from the icedtea-6 tree. -- This email is: [ ] actionable [ ] fyi [x] social Response needed: [ ] yes [x] up to you [ ] no Time-sensitive: [ ] immediate [ ] soon [x] none |