9 comments

  • molticrystal5 hours ago
    Chrome has 1496 [0] known options as of today, maybe after a few more pushes they&#x27;ll catch up to the 1843 of JVM.<p>An interface like above to sort things would probably be quite helpful as well.<p>[0] <a href="https:&#x2F;&#x2F;peter.sh&#x2F;experiments&#x2F;chromium-command-line-switches&#x2F;" rel="nofollow">https:&#x2F;&#x2F;peter.sh&#x2F;experiments&#x2F;chromium-command-line-switches&#x2F;</a>
    • deepsun4 hours ago
      Why not compiling it to Java source code (not bytecode)? Users would use their own Java compiler then.<p>Same as, say, ANTLR generates code to parse various texts to AST.
  • Hendrikto10 hours ago
    1843 options is too many. You could never even consider all of the possible combinations and interactions, let alone test them.<p>I have really come to appreciate modern opinionated tooling like gofmt, that does not come with hundreds to thousands of knobs.
    • pron8 hours ago
      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 &quot;product&quot; 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&#x2F;linker configuration flags (only in Java, compilation and linking are done at runtime) and they&#x27;re mostly concerned with various resource constants. It is very rare for most of them to ever be set manually, but if there&#x27;s some unusual environment or condition, they can be helpful.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;openjdk&#x2F;jdk&#x2F;blob&#x2F;master&#x2F;src&#x2F;hotspot&#x2F;share&#x2F;runtime&#x2F;globals.hpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;openjdk&#x2F;jdk&#x2F;blob&#x2F;master&#x2F;src&#x2F;hotspot&#x2F;share...</a>
    • tomaytotomato9 hours ago
      It&#x27;s a result of Java being required to run on many different OS environments (Oracle, Redhat, Windows, RISC&#x2F;ARM&#x2F;x86), along with user constraints and also business requirements.<p>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.<p>As a Java dev, I have maybe used about 10-15 of them in my career.<p>The weirdest&#x2F;funnest one I used was for an old Sun Microsystems Solaris server which ran iPlanet, for a Java EE service.<p>Since this shared resources with some other back of office systems, it was prone to run out of memory.<p>Luckily there was a JVM option to handle this!<p>-XX:OnOutOfMemoryError=&quot;&lt;run command&gt;&quot;<p>It wasn&#x27;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 &quot;Immah eaten all your bytez I ded now, please reboot me&quot;
      • Hendrikto8 hours ago
        &gt; As a Java dev, I have maybe used about 10-15 of them in my career.<p>So do we really need multiple thousand? Having all of them also makes finding the few you actually need much more difficult.
        • KronisLV4 hours ago
          &gt; So do we really need multiple thousand?<p>Assuming that you don&#x27;t need 99.9% of them (they should have sane defaults that you never have to change or even learn that they exist or what they are) until that super rare case when one will save your hide, I&#x27;d lean towards yes.<p>In other words, they might as well be an escape hatch of sorts, that goes untouched most of the time, but is there for a reason.<p>&gt; Having all of them also makes finding the few you actually need much more difficult.<p>This is a good point! I&#x27;d expect the most commonly changed ones (e.g. memory allocation and thread pools) to be decently well documented, on the web and in LLM training data sets. Reading the raw docs will read like noise, however.
      • nkzd9 hours ago
        Which JVM options do you use the most?
        • cogman109 hours ago
          Heap size, GC algorithm.<p>I suggest most people never touch almost any other options. (Flight recording and heap dumps being the exception).
          • marginalia_nu8 hours ago
            GC threads are generally often useful on multi-tenant systems or machines with many cores, as Java will default-size its thread pools according to the number of logical cores. If the server has 16 or more cores, that&#x27;s very rarely something you want, especially if you run multiple JVMs on the same host.<p>Not JVM options, but these are often also good to tune:<p><pre><code> -Djdk.virtualThreadScheduler.parallelism -Djdk.virtualThreadScheduler.maxPoolSize -Djava.util.concurrent.ForkJoinPool.common.parallelism </code></pre> In my experience this often both saves memory and improves performance.
            • cyberpunk4 hours ago
              You can get into difficulty with kubernetes here, as your jvm will detect all cores on the node but you may have set a resources limit on the pod&#x2F;whatever, so it’ll assume it can spend more time doing stuff than it actually can, so often times it’s quite necessary to tune some things to prevent excessive switching etc.
              • dpratt3 hours ago
                Modern JVMs will detect orchestrator-set cgroup limits and size themselves accordingly. If you, for example, set a cpu limit for a pod to “1”, the JVM will size itself as if it was running on a single core machine.
    • elric9 hours ago
      In what way is gofmt remotely comparable to a JVM?<p>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.
      • avianlyric9 hours ago
        gofmt isn’t really comparable to the JVM, but it is a really strong expression of the opinionated tooling GoLang has.<p>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.<p>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.
        • parsd7 hours ago
          I don’t believe the Go compiler would reject unformatted code. The compiler has its own set of rules for what it views as syntactically correct code, but these rules have nothing to do with gofmt’s formatting rules.<p>For example, it’s the compiler and not gofmt that dictates that you must write a curly brace only on the same line of an “if” statement. If you put it on the next line, you don’t have unformatted code - you have a syntax error.<p>However, the compiler doesn’t care if you have too much whitespace between tokens or if you write your slice like []int{1, 2,3,4}, but gofmt does.<p>We could say the rules of the compiler and gofmt don’t even overlap.
        • kfuse8 hours ago
          They do worry, they just can&#x27;t do anything about it. Like the fact that error handling code takes at least three lines no matter how trivial it is. I&#x27;m sure error handling would not be critisized nearly as much if it didn&#x27;t consume so much vertical space and could fit in one line, which go compiler does allow.
        • elric8 hours ago
          That&#x27;s all well and good, but entirely irrelevant to the number of options a JVM should reasonably have.
    • layer86 hours ago
      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.<p>The JVM is like an operating system. A better comparison would be Linux kernel parameters: <a href="https:&#x2F;&#x2F;www.kernel.org&#x2F;doc&#x2F;html&#x2F;latest&#x2F;admin-guide&#x2F;kernel-parameters.html" rel="nofollow">https:&#x2F;&#x2F;www.kernel.org&#x2F;doc&#x2F;html&#x2F;latest&#x2F;admin-guide&#x2F;kernel-pa...</a>
    • eru9 hours ago
      &gt; You could never even consider all of the possible combinations and interactions, let alone test them.<p>Nobody has ever tested all possible inputs to 64 bit multiplication either. You can sample from the space.
      • pixl979 hours ago
        Eh that sounds a bit different to me, multiplication should be roughly the same operator on each test, these are wildly different functions.
        • deepsun8 hours ago
          You forgot about NaNs (all of them), infinities and positive&#x2F;negative zeros. Tests warranted.
          • MaxBarraclough4 hours ago
            Don&#x27;t forget the Intel floating-point division bug from the 90s.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Pentium_FDIV_bug" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Pentium_FDIV_bug</a>
    • Geezus_428 hours ago
      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.<p>I.E. Instead of &quot;&lt;DOMAIN&gt; TLS Handshake failed&quot; it will be something like &quot;ERROR: PKIX failed&quot;. 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.
      • deepsun8 hours ago
        I hate when tools only produce generic &quot;TLS Handshake failed&quot; instead of saying why exactly it failed, where is the problem.
        • thunky8 hours ago
          Sounds like you&#x27;d both be happy if the tool produced both.
          • Geezus_427 hours ago
            Sounds to me that deepsun and I are in agreement that an error message should tell you what the actual error was.<p>I.E. ERROR: TLS handshake failed: &lt;DOMAIN&gt; certificate chain unverified
          • appplication7 hours ago
            This is why stack traces exist. But I agree Java seems to not really have a culture of “make the error message helpful”, but instead preferring “make the error message minimal and factual”.<p>For what it’s worth, the rise of helpful error messages seems to be a relatively new phenomenon the last few years.
        • kitd7 hours ago
          This is the kind of scenario that is served better by Go&#x2F;C-style error values than exceptions. Error values facilitate and encourage you to log what you were doing at the precise point when an error occurs. Doing the same with exceptions idiomatically often requires an exception hierarchy or copious amounts of separate try&#x2F;catches.<p>The difference really becomes apparent when trying to debug a customer&#x27;s problem at 3am (IME).
      • well_ackshually6 hours ago
        So your issue isn&#x27;t with Java, just with shit error messages and devs clearing the exception stack.
    • deepsun9 hours ago
      Just because you have more features and ways to use them. Say I like to use a different garbage collector for a tool.
    • mzi9 hours ago
      One of my nerd-quizzes I hade at interviews before was &quot;what letters in what case are NOT flags to GNU ls&quot;.
      • eru9 hours ago
        The answer is &#x27;man ls&#x27;. And: &#x27;almost all letters of unicode&#x27;.
    • pjmlp6 hours ago
      Have you ever seen how many GCC has for plain old C?
      • Hendrikto4 hours ago
        Yeah, that’s a mistake too, and a big reason for why compiling C projects is such a pain.<p>Notice how I did not compare to C, but modern alternatives.
        • pron2 hours ago
          I&#x27;ll grant you that Go is extremely opinionated; that&#x27;s its shtick. But it&#x27;s an old language that started out with a 1970s design as a statement by its creators against modern programming languages. From its langnauge design, through its compiler, to its GC algorithm, it is intentionally retro (Java retired its Go-like GC five years ago because the algorithm was too antiquated). It may suit your taste and I&#x27;m not suggesting that it&#x27;s bad, but modern it is not.
        • pjmlp3 hours ago
          Gccgo and tinygo do exist, with enough parameters.
    • RadiozRadioz9 hours ago
      I don&#x27;t think modernity is a noteworthy factor as to whether tooling is opinionated.
    • tezza9 hours ago
      How is this different to system tuning parameters in Linux &#x2F;proc, FreeBsd, Windows Registry, Firefox about:config, sockopt, ioctl, postgres?<p>Zillions of options. Some important, some not
    • TacticalCoder7 hours ago
      &gt; 1843 options is too many. You could never even consider all of the possible combinations and interactions, let alone test them.<p>You can search for those that may concern you. Good old search or AI &quot;search&quot;.<p>For example I recently did test the AOT compilation of Clojure (on top of the JVM) code using &quot;Leyden&quot;. 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&#x2F;verifying the Leyden JVM, testing, taking notes about the project, testing on different machines, etc.).<p>These are not trivial calls to the &quot;java&quot; command: it involves a specific JVM and several JVM params that have to work fine together.<p>The goal was to load 80 000 Clojure&#x2F;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 <i>much</i> more complicated&#x2F;annoying to get right.<p>It can look overwhelming but I&#x27;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>P.S: unrelated to TFA and as a bonus for the &quot;Java is slow crowd&quot;:<p><pre><code> time java -jar hello&#x2F;hello.jar Hello, World! real 0m0.040s </code></pre> And that&#x27;s without any Leyden&#x2F;GraalVM trick. For Clojure the &quot;slow&quot; startup times are due to each Clojure function being transformed into one Java .class each and there are <i>many</i> Clojure functions. Hence the test with 80 000 Clojure functions from the project I reused: <a href="https:&#x2F;&#x2F;github.com&#x2F;jarppe&#x2F;clojure-app-startup-time-test" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jarppe&#x2F;clojure-app-startup-time-test</a> (but it&#x27;s not maintained, won&#x27;t work as if with the latest Leyden JVM)
      • vips7L6 hours ago
        I could be missing it because I’m not that familiar with bb, but looking at your repository it doesn’t look like you’re using any feature that was actually shipped with project Leyden. It looks like you’re just using AppCDS which has been around for a long time.
      • nromiun5 hours ago
        That test does not mean anything. I can also spin up a large LLM on my 5090 and say these models are ready for on device deployment now. However that would not be true for most people. You should test a Golang hello world binary as well. I bet it will take less than 40 milliseconds.
    • fHr7 hours ago
      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.
    • quotemstr8 hours ago
      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 &quot;right&quot; knob.
    • jmyeet7 hours ago
      Wasn&#x27;t it Joel Spolsky who said every option is a cop out? Or maybe Steve Yegge? I forget. It&#x27;s something I agree with. I often have this thought when going through the options of something conceptually fairly simple: &quot;who is this for? who actually uses this option?&quot;<p>I kinda feel the same way with C&#x2F;C++ warnings. Different code bases decide if different warnings are errors. That was a mistake (IMHO).<p>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&#x27;s just hiding the complexity. I wonder if it would&#x27;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 &#x2F;proc parameters for that in Linux, for example, but it&#x27;s also segregated (eg using BRR).<p>At the end of the day, none of this really matters. As in, the JVM is mature and I think generally respected.
      • vips7L6 hours ago
        The GC is pluggable, that’s why you have so many to choose from depending on your work load. You rarely if ever have to touch those options. In the last 10 years all of my apps, since I run on a modern version of Java, only ever set max heap size and soon that will (finally) be figured out automatically: <a href="https:&#x2F;&#x2F;openjdk.org&#x2F;jeps&#x2F;8359211" rel="nofollow">https:&#x2F;&#x2F;openjdk.org&#x2F;jeps&#x2F;8359211</a>
      • izacus5 hours ago
        Joe Spolsky also never created anything as popular and widely deployed as Java. It&#x27;s easy to bloviate about pure software when it doesn&#x27;t need to literally run the whole world as you know it.
        • toyg3 hours ago
          Er. IIRC, Spolsky was involved in creating VBA for Excel. Which was arguably orders of magnitude more popular (and still more widely deployed and world-supporting) than Java.
          • izacus2 hours ago
            In the 90s, as a program manager. And it&#x27;s a big difference between building an application and a platform (I&#x27;ve done both) when it comes to API design.
  • exabrial5 hours ago
    His other project &quot;Byte Me&quot;, along with judicious javap usage, has been super useful for me learning JVM bytecode so I could make a machine learning model compiler for the JVM (basically compile your ML models as native code; ONNX, tree ensembles, regressors, classifiers, etc as native JVM classes with no massive runtime needed)<p>still in the works, but its here for those interested: Petrify: <a href="https:&#x2F;&#x2F;github.com&#x2F;exabrial&#x2F;petrify" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;exabrial&#x2F;petrify</a>
  • coolius9 hours ago
    This is going to come very handy for development of CodeBrew, my Java IDE for iPhone&#x2F;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!<p>For anyone intered, here&#x27;s the app:<p><a href="https:&#x2F;&#x2F;apps.apple.com&#x2F;app&#x2F;apple-store&#x2F;id6475267297?pt=119146871&amp;ct=hn&amp;mt=8">https:&#x2F;&#x2F;apps.apple.com&#x2F;app&#x2F;apple-store&#x2F;id6475267297?pt=11914...</a>
  • motoboi6 hours ago
    People say we don’t build cathedrals anymore.<p>But here it is: JVM is a modern cathedral.
    • well_ackshually6 hours ago
      Multiple generations of builders working together on a grand plan, constantly interrupted by multiple generations of ~~kings~~ multibillion dollar corporations to please add ~~a grand mural remembering his great deeds~~ yet another flag to control exactly the timing of GC pauses because it turns out our server can only do GC between 3 and 3:30 AM.
  • zkmon4 hours ago
    Those button at the top link to different domains altogether, but present the same page. So it is one page with multiple domains, instead of one domain with multiple pages.
  • scrame1 hour ago
    OK, now make them all run at once!<p>(I know many conflict and there is not a shell buffer long enough to handle all that)<p>Kidding aside, I actually said &quot;ugh, seriously&quot; when I saw that there were literally thousands of options. Is there a public program with more options?
  • guusbosman9 hours ago
    There is a 2nd edition now of the Optimizing Java book you are referring to on your site.
    • grodriguez1008 hours ago
      He probably knows, since he is one of the authors.
  • rvz8 hours ago
    All of that configuration and it will <i>always</i> be less efficient than Rust, or even Golang.<p>This is why lots of engineers waste time fiddling with options to tune the JVM and still require hundreds of replicated micro-services to &quot;scale&quot; their backends and losing money on AWS and when they will never admit the issue is the technology they have chosen (Java) and why AWS loves their customers using inefficient and expensive technologies.<p>Even after that, both Go and Rust continue to run rings around the JVM no matter the combination of options.
    • cleverfoo8 hours ago
      Sure, for a very narrow definition of _efficiency_. There&#x27;s plenty to complain in terms of the JVM and Java but performance, as in units of work per dollar spent, is not one of them - JITs just have too many opportunities for optimizing generated code.
    • deepsun8 hours ago
      All of that tooling and Rust will always be less efficient than Assembler.
      • metaltyphoon7 hours ago
        I… didn’t think this makes sense :)
        • msla44 minutes ago
          It makes perfect sense: Rust compilers will never beat a human at scheduling every single opcode perfectly based on the deepest microarchitectural analysis short of decapping the chip and breaking out the ol&#x27; electron microscope. Whether it&#x27;s worthwhile to be that efficient over a whole program, as opposed to a preternaturally tight compute kernel, is definitely questionable.
    • well_ackshually6 hours ago
      That&#x27;s a nice source, from where up your ass did you find it ?<p>Go&#x27;s GC is absolutely awful and leads to nondeterministic pauses and catastrophic latency spikes, especially when the memory pressure and capacity is high. Throw the go GC against a 256GB heap, see how well it survives.<p>Technologies have strong and weak points. Go&#x27;s strong points are small, targeted pieces of software and having 66% of a binary basically be if err != nil return err. Rust&#x27;s strong points are that you get to have the symbol&lt;():soup&lt;_, |_| of { c++ }&gt;&gt; while not saying you&#x27;re writing c++ and feeling really smug when you say that you only needed to use 5 Arc&lt;Mutex&lt;T&gt;&gt; and rewrote your entire software three times but at least it runs almost as fast as some shitty C that does fgets() in the middle of a hot loop. Java lets you spawn spring boot and instantiate a string through reflection because why not.<p>I promise you, I can write allocation heavy FizzBuzzEnterpriseFactoryFactories in Rust too.
    • arein37 hours ago
      Yeah doubt that<p>Recently I had a python friend use the most balls to the wall python backend, he couldnt beleive java was faster, but the numbers werent lying. We did 1 billion iterations of adding a float, took a few seconds in java.
    • fHr7 hours ago
      I was a diehard java fanboy but using Rust in the last 5 years more and more I have to agree, but sadly huge Java corporate codebases keep my bills paid still, so I have to deal with it. It is what it is. Also agree the pipeline etc. they love all the waste of the compute in their pocket.
      • deepsun3 hours ago
        I code on both and they are just for different purposes. E.g. I think it&#x27;s madness to develop desktop apps in Rust.<p>Development velocity is way greater in Java.
      • contraposit5 hours ago
        I hope AI will make automated translation of such legacy codebases into any favourite langauge possible in future. Fingers crossed.
      • newsoftheday5 hours ago
        It sounds like you&#x27;re not into Java. Perhaps consider switching languages to make room for people who are.