logoalt Hacker News

Hendriktotoday at 11:20 AM15 repliesview on HN

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.


Replies

prontoday at 12:38 PM

These are all the options that have ever existed, including options that are or were available only in debug builds used during development and diagnostic options. There are still a few hundred non-diagnostic "product" flags at any one time, but most are intentionally undocumented (the list is compiled from the source code [1]) and are similar in spirit to compiler/linker configuration flags (only in Java, compilation and linking are done at runtime) and they're mostly concerned with various resource constants. It is very rare for most of them to ever be set manually, but if there's some unusual environment or condition, they can be helpful.

[1]: https://github.com/openjdk/jdk/blob/master/src/hotspot/share...

tomaytotomatotoday at 11:59 AM

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"

show 2 replies
elrictoday at 11:59 AM

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.

show 1 reply
layer8today at 3:19 PM

The comparison with gofmt makes no sense. If Go had myriads of compiler implementations (the analogy being target environments for the JVM) that all had different performance characteristics and other behavioral differences depending on how the source code is formatted, you bet that gofmt would have a lot of options as well.

The JVM is like an operating system. A better comparison would be Linux kernel parameters: https://www.kernel.org/doc/html/latest/admin-guide/kernel-pa...

erutoday at 12:11 PM

> 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.

show 1 reply
Geezus_42today at 12:28 PM

As a sysadmin, not developer, I hate Java almost as much as Windows. The error messages Java apps produce are like coded messages that you have to decipher.

I.E. Instead of "<DOMAIN> TLS Handshake failed" it will be something like "ERROR: PKIX failed". So now I have to figure out that PKIX is referring to PKI and it would make too much sense to provide the domain that failed. Instead I have to play the guessing game.

show 2 replies
pjmlptoday at 2:51 PM

Have you ever seen how many GCC has for plain old C?

show 1 reply
deepsuntoday at 11:31 AM

Just because you have more features and ways to use them. Say I like to use a different garbage collector for a tool.

mzitoday at 11:31 AM

One of my nerd-quizzes I hade at interviews before was "what letters in what case are NOT flags to GNU ls".

show 1 reply
RadiozRadioztoday at 11:43 AM

I don't think modernity is a noteworthy factor as to whether tooling is opinionated.

tezzatoday at 11:29 AM

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

TacticalCodertoday at 1:52 PM

> 1843 options is too many. You could never even consider all of the possible combinations and interactions, let alone test them.

You can search for those that may concern you. Good old search or AI "search".

For example I recently did test the AOT compilation of Clojure (on top of the JVM) code using "Leyden". I used an abandoned Github project as a base but all the JVM parameters related to Leyden had changed names (!) and the procedure had to be adapted. I did it all (as a Dockerfile) in less than an hour with Sonnet 4.6 (complete with downloading/verifying the Leyden JVM, testing, taking notes about the project, testing on different machines, etc.).

These are not trivial calls to the "java" command: it involves a specific JVM and several JVM params that have to work fine together.

The goal was to load 80 000 Clojure/java classes (not my idea: the original project did that part) and see the results: 1.5 seconds to launch with the Leyden JVM (and correct params) vs 6 seconds for a regular launch (so a 75% gain). GraalVM is even faster but much more complicated/annoying to get right.

It can look overwhelming but I'd say all these parameters are there for a reason and you only need a few of them. But when you need them, you need them.

P.S: unrelated to TFA and as a bonus for the "Java is slow crowd":

    time java -jar hello/hello.jar
    Hello, World!

    real    0m0.040s
And that's without any Leyden/GraalVM trick. For Clojure the "slow" startup times are due to each Clojure function being transformed into one Java .class each and there are many Clojure functions. Hence the test with 80 000 Clojure functions from the project I reused: https://github.com/jarppe/clojure-app-startup-time-test (but it's not maintained, won't work as if with the latest Leyden JVM)
show 2 replies
fHrtoday at 1:35 PM

Thank god you have no say in where modern tooling is heading, at the creator of the site, absolute right choice to leave it up to the user to chose all options.

quotemstrtoday at 12:43 PM

In the age of LLMs coupled with open source software, option count is unlimited. I fork FOSS projects and modify them for my own use all the time. Sometimes, with an agent, doing so is even easier than finding the "right" knob.

jmyeettoday at 1:57 PM

Wasn't it Joel Spolsky who said every option is a cop out? Or maybe Steve Yegge? I forget. It's something I agree with. I often have this thought when going through the options of something conceptually fairly simple: "who is this for? who actually uses this option?"

I kinda feel the same way with C/C++ warnings. Different code bases decide if different warnings are errors. That was a mistake (IMHO).

The other thought I have scanning these options is how many are related to GC. I kinda think GC is a bit of a false economy. It's just hiding the complexity. I wonder if it would've been better to push GC to be pluggable rather than relying on a host of options, a bit like TCP congestion management. I mean there are /proc parameters for that in Linux, for example, but it's also segregated (eg using BRR).

At the end of the day, none of this really matters. As in, the JVM is mature and I think generally respected.

show 2 replies