JVM Options Explorer
37 points
1 hour ago
| 3 comments
| chriswhocodes.com
| HN
coolius
10 minutes ago
[-]
This is going to come very handy for development of CodeBrew, my Java IDE for iPhone/iPad. It runs a full OpenJ9 JVM under the hood, and I had to do a bunch off massaging with the options to get it to run properly. I wish I had known this page sooner!

For anyone intered, here's the app:

https://apps.apple.com/app/apple-store/id6475267297?pt=11914...

reply
Hendrikto
1 hour ago
[-]
1843 options is too many. You could never even consider all of the possible combinations and interactions, let alone test them.

I have really come to appreciate modern opinionated tooling like gofmt, that does not come with hundreds to thousands of knobs.

reply
tomaytotomato
28 minutes ago
[-]
It's a result of Java being required to run on many different OS environments (Oracle, Redhat, Windows, RISC/ARM/x86), along with user constraints and also business requirements.

In a way you can use this list of JVM options to illustrate how successful Java has become, that everyone needs an option to get it to work how they like it.

As a Java dev, I have maybe used about 10-15 of them in my career.

The weirdest/funnest one I used was for an old Sun Microsystems Solaris server which ran iPlanet, for a Java EE service.

Since this shared resources with some other back of office systems, it was prone to run out of memory.

Luckily there was a JVM option to handle this!

-XX:OnOutOfMemoryError="<run command>"

It wasn't too important so we just used to trigger it to restart the whole machine, and it would come back to life. Sometimes we used to mess about and get it to send funny IRC messages like "Immah eaten all your bytez I ded now, please reboot me"

reply
nkzd
18 minutes ago
[-]
Which JVM options do you use the most?
reply
cogman10
12 minutes ago
[-]
Heap size, GC algorithm.

I suggest most people never touch almost any other options. (Flight recording and heap dumps being the exception).

reply
elric
28 minutes ago
[-]
In what way is gofmt remotely comparable to a JVM?

In reality the number of options is significantly smaller than the 1843 you mentioned. The list contains boatloads of duplicates because they exist for multiple architectures. E.g. BackgroundCompilation is present on 8 lines on the OpenJDK 25 page: aarch64, arm, ppc, riscv, s390, x86 and twice more without an architecture.

reply
avianlyric
17 minutes ago
[-]
gofmt isn’t really comparable to the JVM, but it is a really strong expression of the opinionated tooling GoLang has.

While gofmt is “just” a formatting tool. The interesting part is that go code that doesn’t follow the go formatting standard is rejected by the go compiler. So not only does gofmt not have knobs, you can’t even fork it to add knobs, because the rest of the go ecosystem will outright reject code formatted in any other way.

It’s a rather extreme approach to opinionated tooling. But you can’t argue with the results, nobody writing go on any project ever worries about code formatting.

reply
eru
16 minutes ago
[-]
> You could never even consider all of the possible combinations and interactions, let alone test them.

Nobody has ever tested all possible inputs to 64 bit multiplication either. You can sample from the space.

reply
pixl97
11 minutes ago
[-]
Eh that sounds a bit different to me, multiplication should be roughly the same operator on each test, these are wildly different functions.
reply
mzi
56 minutes ago
[-]
One of my nerd-quizzes I hade at interviews before was "what letters in what case are NOT flags to GNU ls".
reply
eru
16 minutes ago
[-]
The answer is 'man ls'. And: 'almost all letters of unicode'.
reply
deepsun
56 minutes ago
[-]
Just because you have more features and way to use them. Say I like to use a different garbage collector for a tool.
reply
RadiozRadioz
44 minutes ago
[-]
I don't think modernity is a noteworthy factor as to whether tooling is opinionated.
reply
tezza
58 minutes ago
[-]
How is this different to system tuning parameters in Linux /proc, FreeBsd, Windows Registry, Firefox about:config, sockopt, ioctl, postgres?

Zillions of options. Some important, some not

reply
guusbosman
58 minutes ago
[-]
There is a 2nd edition now of the Optimizing Java book you are referring to on your site.
reply