News for hackers. Stuff that matters.
Re:The decline and fall of Java on the desktop by kaba0 on Wednesday March 02, 2022 @05:28PM (#30534159)
That’s the fault of jetbrains, not java. They release it with way too old JRE with custom patches and quite shitty default arguments, while it works eons better with no argument at all on an up-to-date jdk, but even more so with the single setting of a low-latency GC, ZGC.

The JVM is a beast, why do you think a good deal of all serious web applications run on top of it?

Re:The decline and fall of Java on the desktop by vishnugupta on Thursday March 03, 2022 @04:28AM (#30538963)
> The JVM is a beast, why do you think a good deal of all serious web applications run on top of it?

When I run a Java app-server I'm happy to, in fact it's unwise not to, allocate it the maximum possible RAM the underlying server has. That's because I know for sure JVM is the only thing that's going to be running on a server.

On a desktop it's a totally different story. IntelliJ has to compete with other applications for RAM because I'm constantly multi-tasking between browser tabs, Apple Music, Slack app and what not. So allocating RAM to JVM apps on desktop is a world of pain because I, as a desktop user, just don't (want to) know how to fine-tune hardware resources for different apps. I don't allocate heap to Safari, why should it be the case with IntelliJ? Why can't they figure out? Or maybe there should be a desktop version/mode of JVM that'll figure out ideal RAM size and work with it and expand/shrink as needed?

Re:The decline and fall of Java on the desktop by nyanpasu64 on Wednesday March 02, 2022 @08:13PM (#30535845)
Minecraft on modern JVMs still requires setting memory usage based on how much free RAM you have (though not GC tuning to the same extent as before).
Re:The decline and fall of Java on the desktop by lmm on Wednesday March 02, 2022 @10:21PM (#30536744)
> The JVM is a beast, why do you think a good deal of all serious web applications run on top of it?

The JVM sacrifices latency for throughput, which is good for servers but not for desktops.

Re:The decline and fall of Java on the desktop by kaba0 on Thursday March 03, 2022 @01:26AM (#30537832)
Look at ZGC GC. It has less latency due to stop-the-words than what the OS scheduler causes. (Of course at the price of throughput). But also the default GC, while on default being more throughput preferring can be tuned by a single paramater.
Re:The decline and fall of Java on the desktop by lmm on Thursday March 03, 2022 @02:12AM (#30538056)
> Look at ZGC GC.

I did, it caused huge pauses with my application (I think probably a bug).

> But also the default GC, while on default being more throughput preferring can be tuned by a single paramater.

Sure, but how many people will do even that much tuning? Defaults are important, and IMO Java chooses a bad one; responsive by default and tuneable when you need maximum throughput is better than the reverse. (I suspect they picked the defaults they did to be competitive against C++ in benchmarks, but we're well past the time where that's what you're competing with).

Same as how Go and Electron have been very successful - not because they're great to work in per se, but because they have so much less friction between writing a hello world program and getting an executable you can distribute.

Re:The decline and fall of Java on the desktop by kaba0 on Thursday March 03, 2022 @02:53AM (#30538300)
That’s not how it works. It’s not like Java’s GCs in the last decade had any sort of huge pauses unless the program did some stupid shit like allocation in a hot loop. (G1GC, the default since 9 promises by default a 10ms max pause time and it can uphold that under crazy conditions even — and even after that it will get progressively slower instead of a huge increase)

Java’s GCs are the state of the art, if they struggle with a workload then it is pretty much guaranteed that other GCs have already broken down completely at the fraction of that.

Regarding your application, did you check how many objects have you allocated? VisualVM and the like can show you precisely the statistics of your allocations.

Re:The decline and fall of Java on the desktop by lmm on Thursday March 03, 2022 @03:06AM (#30538406)
> That’s not how it works. It’s not like Java’s GCs in the last decade had any sort of huge pauses unless the program did some stupid shit like allocation in a hot loop.

Or there's a bug. There's a reason ZGC is marked as experimental. G1GC handled the application in question fine, we reverted to that and it wasn't worth our time investigating further.

Re:The decline and fall of Java on the desktop by kaba0 on Thursday March 03, 2022 @03:29AM (#30538570)
While there is a possibility of a bug, I really doubt it. G1GC is just a beast and likely has just no problem with the allocation-rate your program uses while ZGC has quite a tradeoff for really low latency.