r/programming • • Sep 15 '20

Java 15 released!

https://jdk.java.net/15/
214 Upvotes

130 comments sorted by

View all comments

215

u/Ravoos Sep 15 '20 edited Sep 15 '20

Java devs: Cool.....I'm still using Java 8 tough.

Edit: Okay, I got a lot of interesting comments here when I just made a joke. Still, it is fun to read it all and to see just bow dedicated the Java guys are to their language

42

u/Bartolomev Sep 15 '20

I'm happy that in our company we moved (still moving actually) to Java 11, newer projects at least. My colleagues are still afraid of using var though, so nothing changed really.

38

u/pron98 Sep 15 '20

so nothing changed really

Except lower footprint, higher performance and better profiling with JFR, all of which can save you real money (to make even more money, use JDK 15).

7

u/[deleted] Sep 16 '20

> Except lower footprint

This was not my experience when my company migrated java 8 -> 11. We saw a number of our services increase RSS size by around 1gb. There was oddly no accounting for the increase in memory size in the heap dumps or native memory tracking, we eventually just accepted that some services would use more memory.

9

u/pron98 Sep 16 '20 edited Sep 16 '20

Do you mean that there's more heap consumed by data or that the Java process takes up more RAM from the OS? If it's the former, it is indeed strange and does require investigation (e.g. the footprint of most strings has been nearly halved in JDK 9, and this is the general trend of overall footprint we see). If the latter, it's probably a simple matter of different defaults. Remember that a Java process takes as much RAM as you tell it; if you don't, it will take up some heuristically-chosen default value that can change significantly from one release to another (I think that the default for G1, which is the default GC since 9, is to now take up 1/4 of total RAM unless you tell it otherwise).

-1

u/[deleted] Sep 16 '20

> Do you mean that there's more heap consumed by data or that the Java process takes up more RAM from the OS

The answer to this question is stated twice in my answer.

> increase RSS size by around 1gb

Resident set size is physical memory, i.e. RAM.

> no accounting for the increase in memory size in the heap dumps

For your other questions:

> Remember that a Java process takes as much RAM as you tell it

I mentioned taking heap dumps and using the Java native memory tracker in my answer, obviously I'm aware of the options for RAM. We set max sizes for heap size, meta space, direct memory, etc. If it was one of those, we would have been able to see the difference in the native memory tracker output. Instead there was a gap between the resident memory size used by the JVM and the memory reported by the native memory ticket. I filed a ticket with the hotspot mailing list, but the devs seem uninterested.

6

u/pron98 Sep 16 '20 edited Sep 16 '20

I filed a ticket with the hotspot mailing list, but the devs seem uninterested.

As one of the devs, I can attest that we are always very interested, especially when dealing with such a serious regression. Sometimes, however, things can be deprioritised if it is judged that the situation would only affect a very small minority of people. Can you please point me out to the relevant message you sent and I'll try to find out what happened? (EDIT: continued privately)