Originally reported at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Strange_Memory_Behavior_on_Toolforge_with_Java by @Fastily:
Hi all, when I run the following command on toolforge:
jsub -once -mem 2g -quiet -j y -o a.txt java -Xmx1G -version
And view the log file:
$ cat a.txt Error occurred during initialization of VM Could not allocate metaspace: 1073741824 bytesI see an error related to (lack of) memory. Changing the memory values to something crazy seems to yield the desired output.
For example:
$ jsub -once -mem 8g -quiet -j y -o a.txt java -Xmx4G -version $ cat a.txtresults in the desired output
openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment (build 11.0.2+9-Debian-3bpo91) OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3bpo91, mixed mode, sharing)That leaves me with the following questions
- Is this a bug or the expected behavior?
- Is the latter example the best practice on toolforge these days (i.e. set crazy memory values)?
Thanks in advance.