News for hackers. Stuff that matters.
Re:GC progress from JDK 8 to JDK 17 by vletal on Wednesday November 24, 2021 @09:42AM (#29330397)
I like how this reached the top page soon after "Go does not need a Java-style GC" (https://news.ycombinator.com/item?id=29319160).

Moreover, are the significantly lower GC pause times help improve snappiness of GUI apps, such as IntelliJ IDEA?

Re:GC progress from JDK 8 to JDK 17 by Erlangen on Wednesday November 24, 2021 @09:59AM (#29330579)
Intellij uses UseConcMarkSweepGC gc, which has been deprecated since Java 9. Jetbrains is still investigating the use of ZGC. https://youtrack.jetbrains.com/issue/IDEA-247824
Re:GC progress from JDK 8 to JDK 17 by Ind007 on Wednesday November 24, 2021 @10:52AM (#29331186)
It is defaulted to G1 now(I have 2021.2.2 version).
Re:GC progress from JDK 8 to JDK 17 by Erlangen on Wednesday November 24, 2021 @11:58AM (#29332120)
I am running 2021.2.3 now. `ps aux | grep GC` still shows "-XX:+UseConcMarkSweepGC"
Re:GC progress from JDK 8 to JDK 17 by stusmall on Wednesday November 24, 2021 @04:05PM (#29335134)
-XX:+UseG1GC on my install of clion. Maybe old JVM parameters have persisted in settings somewhere?
Re:GC progress from JDK 8 to JDK 17 by cesarb on Wednesday November 24, 2021 @04:42PM (#29335522)
> Maybe old JVM parameters have persisted in settings somewhere?

This is an annoying behavior on at least Intellij Idea (I don't know about other Intellij products). If you ever increased its memory limit (it's an option on one of the top-level menus, and it will also occasionally suggest increasing it if it ever notices it's using too much memory), it copies the idea64.vmoptions file which contains not only the memory limit (-Xmx), but all the JVM parameters, from the binary directory to your configuration directory, and so the JVM parameters on it will be kept forever, instead of being changed when you update the IDE. The fix is easy: find that copied idea64.vmoptions file, write down the memory limit on it, remove that file, restart the IDE, and go to that top-level menu option to set the limit again. This will copy an updated set of VM options to your configuration directory.

Re:GC progress from JDK 8 to JDK 17 by finalfantasia on Wednesday November 24, 2021 @02:40PM (#29334219)
They changed the default garbage collector to G1 last year.[1]

[1] https://github.com/JetBrains/intellij-community/commit/edf1c...

Re:GC progress from JDK 8 to JDK 17 by darksaints on Wednesday November 24, 2021 @10:22AM (#29330817)
Honestly this is the most frustrating thing about Jetbrains. Stop investigating shit and just use the new JVMs already. There is no excuse for using deprecated JVMs.
Re:GC progress from JDK 8 to JDK 17 by astange on Wednesday November 24, 2021 @10:37AM (#29330987)
Edit the idea64.vmoptions config file and use the GC of your choice. I've been running with ShenandoahGC for quite some time now and it's been working great.

Also, see https://github.com/JetBrains/JetBrainsRuntime/releases/tag/j... for a JDK17 runtime for Intellij products. I've been running this too and it works great (but does require some tweaks to the vmoptions file).

Re:GC progress from JDK 8 to JDK 17 by 5e92cb50239222b on Wednesday November 24, 2021 @11:58AM (#29332126)
Text can look pretty bad if you're using other JVMs without their patches.
Re:GC progress from JDK 8 to JDK 17 by hawk_ on Wednesday November 24, 2021 @01:10PM (#29333098)
Yes particularly on Linux, any non jetbrains jdk running intellij looks awful. I don't know if the consider it as some kind of competitive advantage to not submit fixes upstream.
Re:GC progress from JDK 8 to JDK 17 by belter on Wednesday November 24, 2021 @03:24PM (#29334697)
What are they doing in the JVM to make text look good?
Re:GC progress from JDK 8 to JDK 17 by vips7L on Wednesday November 24, 2021 @10:57AM (#29331268)
I tried this last year but the version they shipped with IDEA didn't have ZGC and using an external JVM caused some weirdness in the GUI for me.
Re:GC progress from JDK 8 to JDK 17 by parhamn on Wednesday November 24, 2021 @02:31PM (#29334128)
Curious before I try it, is the speed/performance any better?
Re:GC progress from JDK 8 to JDK 17 by astange on Wednesday November 24, 2021 @03:31PM (#29334777)
It depends. There is less latency in the IDE due primarily to better GC (just as the article describes). I think the speed is better too on things like indexing the code base, but that could depend on your computer. I'm running on a 32core high end AMD system with lots of RAM, and I increase the heap setting in Intellij to 4G, etc. I think the IDE is subjectively better.

We run all our production applications on JDK17 too, which is why I push to run everything on 17.

Re:GC progress from JDK 8 to JDK 17 by lmilcin on Wednesday November 24, 2021 @11:13AM (#29331466)
I am pretty sure Jetbrains cares their product works well for a lot of people and they know better than you which JVM is better for their product.

It is not like it restricts what you can build with it.

We may not know their exact decision process but it is incredibly ignorant to assume they are just doing this out of laziness or incompetence.

Re:GC progress from JDK 8 to JDK 17 by darksaints on Wednesday November 24, 2021 @12:26PM (#29332524)
They've already explained their reasoning, I don't have to assume anything. Their reasoning is bad:

* They've fixed long-known bugs in the JVM

* They've added sub-pixel anti-aliasing and other visual rendering enhancements.

Both of these are clear improvements on the JVM, and very likely to be accepted upstream, but instead of upstreaming them, they decided to create a long-running fork and package it as their own runtime. And like all long-running forks, they're struggling to keep up.

So we are left with two choices: abandon the hope of a functional IDE that only works well on a customized runtime, or abandon the litany of performance, capability, security, and stability improvements in the JVM standard and reference JVM implementation.

Re:GC progress from JDK 8 to JDK 17 by lmilcin on Wednesday November 24, 2021 @12:31PM (#29332591)
But what is your problem with this? Do you really care which JVM is being packaged or you are just picking on something that isn't a problem?

Have you had a problem running IntelliJ IDEA?

I am pretty sure that if I was distributing a very, very complex Java application for a very, very wide variety of audience (like people who aren't even developers because IDEA also caters to these people) I would distribute it with JVM packaged.

And then the user should not care which JVM exactly is being distributed. You only need to care about the end result.

Let me know the last time you cared which version of JVM is used by any of the SAS products you subscribe to.

Re:GC progress from JDK 8 to JDK 17 by darksaints on Wednesday November 24, 2021 @12:45PM (#29332749)
Yes, I care. Because while jetbrains makes an excellent IDE in terms of functionality, they have extremely shitty startup times and garbage collection pauses. These are both areas that have received a lot of attention in the reference JVM in the versions subsequent to their fork. All of the performance problems literally disappear by using a newer OpenJDK version, but then the GUI starts to look and act weird.

I don't know why you would assume that I am asking for them to not package a JDK at all. That's a fucking absurd assumption, and nothing i have said has even suggested that. All I'm asking for is for them to upstream their improvements and package their IDEs with OpenJDK by default so we don't have to choose between Jetbrains improvements or OpenJDK improvements.

Re:GC progress from JDK 8 to JDK 17 by astange on Wednesday November 24, 2021 @12:49PM (#29332805)
This is so removed from reality that it's difficult to know where to start.

For starters, sub-pixel aliasing is a standard part of the JDK and isn't a Jetbrains addition.

What exactly is stopping you from using a standard JDK17 build with Intellij? How is the IDE not functional for you when doing so? How is it improved when using the JDK17 runtime they have on their github page?

Re:GC progress from JDK 8 to JDK 17 by WatchDog on Wednesday November 24, 2021 @06:18PM (#29336362)
I think the Jetbrains Runtime as sub-pixel AA for Linux in particular[0].

I just tried running idea with adoptopenjdk-17 on macos, and it failed to start up, so it doesn't seem that simple.

[0]: https://confluence.jetbrains.com/display/JBR/JetBrains+Runti...

Re:GC progress from JDK 8 to JDK 17 by astange on Saturday November 27, 2021 @04:05PM (#29363481)
Sub-pixel rendering was added in the Java "Mustang" 1.6 release 15 years ago, long before Jetbrains started providing a custom JDK. http://www.ffnn.nl/pages/articles/java/java-2-se-6.0-aesthet...

Trying to use a newer JDK on some applications, like Intellij, may require adding entries to the idea64.vmoptions file to relax the module restrictions that were tightened in JDK 15 and 16, if that app hasn't been updated for those changes. Entries like this: --add-opens=jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED might be needed.

See https://youtrack.jetbrains.com/issue/IDEA-261033 for entries that might be needed.

Re:GC progress from JDK 8 to JDK 17 by darksaints on Wednesday November 24, 2021 @01:08PM (#29333062)
This is easy:

Standard Jetbrains Runtime - slow as fuck, missing a whole host of performance improvements, security updates, and bug fixes since the fork occurred back in JDK8/9 Era.

OpenJDK - ugly as sin, gui becomes glitchy, lose out on customer support channels (first thing they tell you is to use the standard jetbrains runtime)

Newer versions of Jetbrains Runtime - have to reinstall manually every time you update your IDEs. You also lose out on customer support, as they are beta software.

This isn't really a hard problem to solve: find a way to upstream your improvements to the JVM, and then package the upstreamed version. All of these problems go away, and you're even relieved of the burden of maintain a long running fork.

Re:GC progress from JDK 8 to JDK 17 by astange on Wednesday November 24, 2021 @01:41PM (#29333521)
Yes, this is easy:

- The current JBR is JDK11, not JDK8. - You don't need to reinstall anything to use an alternative JDK with the IDE. Just set the IDEA_JDK envar to the JDK of choice. - Ugly as sin is an opinion. I use the IDE with linux on a hidpi display. Looks perfectly acceptable to me...even running with JDK18. - I just reported an issue while running with the JBR17 a few days ago. Jetbrains was perfectly responsive to my issue.

Re:GC progress from JDK 8 to JDK 17 by pjmlp on Wednesday November 24, 2021 @03:18PM (#29334626)
They are in bed with Google, so they need to spend their resources improving Kotlin use cases instead.
Re:GC progress from JDK 8 to JDK 17 by melony on Wednesday November 24, 2021 @10:35AM (#29330973)
I don’t understand why they are not shipping their own bespoke GC to go with Intellij, Jetbrains is already building their own JVMs.
Re:GC progress from JDK 8 to JDK 17 by pjmlp on Wednesday November 24, 2021 @09:49AM (#29330483)
The GC might help, but it doesn't do magic when threads aren't used the correct way, too much stuff lands on the UI thread or synchronous IO is used all over the place.
Re:GC progress from JDK 8 to JDK 17 by edgyquant on Wednesday November 24, 2021 @12:11PM (#29332337)
That’s the magic of HN (or maybe it’s a form of the Baader-Meinhof Phenomenon.) When one topic reaches the front page it seems like a couple more based around it hit the front page the same or next day, which allows us to expand on what we’ve learned.
Re:GC progress from JDK 8 to JDK 17 by Sankozi on Wednesday November 24, 2021 @10:01AM (#29330608)
Snappiness problems are often due to lazy loading Java classes.

For example first time loading project settings takes 1+ seconds while next less than 0.5. This value might get lower later if JVM decides to optimize more some parts of UI application.

Re:GC progress from JDK 8 to JDK 17 by fnord123 on Wednesday November 24, 2021 @10:18AM (#29330762)
I don't think that's where the issues are. IntelliJ freezes when reindexing a project when you change branches from the command line.
Re:GC progress from JDK 8 to JDK 17 by fnord123 on Wednesday November 24, 2021 @09:48AM (#29330468)
Current IntelliJ uses Java11 and has gotten slower over the past few years (anecdata from my own use) - so probably not.
Re:GC progress from JDK 8 to JDK 17 by hiram112 on Wednesday November 24, 2021 @11:22AM (#29331606)
This is what I've noticed too. Intellij has never exactly been speedy, but it had so many great features that it was worth it compared to other slow IDEs like Eclipse. And using a basic text editor like VIM or even VS Code with a big Java project isn't really feasible like it might be in other languages like Python or Node.

However, now it is really bogging down. I'm sure it doesn't help that I've got several IDEs open along with some monstrosity of a "microservice" framework running half a dozen docker services and DBs on an older Macbook Pro, but it's true that app and OS devs tend to use all increases in CPU and ram, and so absolute performance and battery life never seems to get better over the years, regardless of how much the underlying hardware itself has improved.

Re:GC progress from JDK 8 to JDK 17 by vips7L on Wednesday November 24, 2021 @12:33PM (#29332614)
VS Code is fine with with big projects, I've been using it for 2 years. The language server is Eclipse after all.
Re:GC progress from JDK 8 to JDK 17 by pjmlp on Wednesday November 24, 2021 @03:20PM (#29334653)
Red-Hat is behind most of the Java plugins, so their quality is quite good, there is only the pain to live with Electron.
Re:GC progress from JDK 8 to JDK 17 by aenis on Wednesday November 24, 2021 @01:02PM (#29332988)
Not just slower, also energy hugry. My m1 max running pycharm loses about 10pct of charge an hour on their crappy bundled jvm, and around 4% on the latest java17-based ones, but does act weird at times when using them. Its probably down to metal vs opengl. Disappointing.
Re:GC progress from JDK 8 to JDK 17 by thies on Wednesday November 24, 2021 @10:50AM (#29331159)
Since 2020.x it's definitely slower. The addition of jetbrains space doesn't seem to help either and removing the plugin itself makes the whole ide unstable
Re:GC progress from JDK 8 to JDK 17 by vips7L on Wednesday November 24, 2021 @11:12AM (#29331462)
I wish they would just release a light version, without all the database, spring integration, and other crap. I just want a light language server.
Re:GC progress from JDK 8 to JDK 17 by absove on Wednesday November 24, 2021 @11:46AM (#29331950)
wouldn't community edition fit the bill? Those things you mention are the main difference with ultimate.
Re:GC progress from JDK 8 to JDK 17 by vips7L on Wednesday November 24, 2021 @12:26PM (#29332528)
Not sure. I moved to VS Code + Eclipse LS and it's such a more pleasurable experience. However, it doesn't support SBT which is the build tool my company uses.
Re:GC progress from JDK 8 to JDK 17 by hocuspocus on Wednesday November 24, 2021 @07:42PM (#29336996)
The community edition is definitely enough for sbt projects.

Any reason you're using sbt for Java projects? That's an odd combination. Anyway, I believe Metals is getting close to supporting this particular use case if you want to keep using VS Code.

Re:GC progress from JDK 8 to JDK 17 by vips7L on Wednesday November 24, 2021 @10:16PM (#29337871)
For some odd reason my company chose the play framework + Java. It's one of the most baffling choices I've ever seen. I've actually managed to get the Java plugins to work with sbt, but it doesn't understand when a Scala object is imported.
Re:GC progress from JDK 8 to JDK 17 by matsemann on Wednesday November 24, 2021 @02:23PM (#29334024)
Just deactivate the plugins?
Re:GC progress from JDK 8 to JDK 17 by 5e92cb50239222b on Wednesday November 24, 2021 @12:00PM (#29332156)
Try power saving mode (look in ctrl+shift+a).
Re:GC progress from JDK 8 to JDK 17 by msie on Wednesday November 24, 2021 @12:37PM (#29332672)
I’ve given up on IntelliJ and java-based UI’s long ago. So disappointing.
Re:GC progress from JDK 8 to JDK 17 by coliveira on Wednesday November 24, 2021 @01:21PM (#29333260)
That's the right way to go. Like IntelliJ or not, Java is a legacy technology. I wouldn't want to depend on that.
Re:GC progress from JDK 8 to JDK 17 by kaba0 on Wednesday November 24, 2021 @01:50PM (#29333623)
Lol, you are laughably bad to think that java is legacy.

The JVM is improving with never before seen speed, has state of the art GCs, a very good JIT compiler, upcoming green threads that will make blocking code automagically unblocking and once Valhalla hits with value types, there really will be very few areas where java would not be applicable.

And on top of that, there is also Graal, which is a novel way to run and optimize mixed-language code bases.

Re:GC progress from JDK 8 to JDK 17 by justbaker on Wednesday November 24, 2021 @09:35PM (#29337670)
>Lol, you are laughably bad to think that java is legacy.

Seriously. It might not be one of the hip new languages with unique features but it’s a very mature language that is well battle tested, has plenty of libraries available, and the talent pool is very deep for Java hires. It’s also something that stands the test of time —- write code in 1999 on an old Java version it will still likely run on that version today.