Live data from Hacker News

Java Turns 25 – Whats Next? [pdf]

oracle.com

281–286 of 286 posts

Re: Java Turns 25 – Whats Next? [pdf]

#281

Earlier quoted context omitted.

> How do you find a reasonably small Xmx that doesn't lead to OutOfMemoryError exceptions? That's tough to figure out. In new versions of Java, I think 14+, if you use ZGC collector it will return unused memory to the OS. Memory options vary depending on collector, but new versions of ZGC support "soft max" heap size and uncommit. Together it might be close to what you're looking for https://malloc.se/blog/zgc-softma…

> I should mention the GC situation was worse until the last few years. Until ZGC and Shenandoah came around, Java still didn't collect frequently but when it did there were long pauses. This feels like G1GC erasure. I'll also say we've tried out ZGC and while pause times were low, it had a huge CPU overhead and the performance of our application was notably worse and we went back to G1GC. We're still on Java 11, so…

20th October, OpenJDK 11.0.9 will be released, with full-fledged Shenandoah GC. It has _very_ low pauses and has the `-XX:ShenandoahGCHeuristics=compact` option, which will promptly give unused memory back to the OS (thus keeping the whole memory profile low).

Give it a try.

https://wiki.openjdk.java.net/display/shenandoah/Main

https://www.slideshare.net/jelastic/choosing-right-garbage-c...

https://twitter.com/shipilev/status/1308320432404168705

Re: Java Turns 25 – Whats Next? [pdf]

#282

Earlier quoted context omitted.

> How do you find a reasonably small Xmx that doesn't lead to OutOfMemoryError exceptions? That's tough to figure out. In new versions of Java, I think 14+, if you use ZGC collector it will return unused memory to the OS. Memory options vary depending on collector, but new versions of ZGC support "soft max" heap size and uncommit. Together it might be close to what you're looking for https://malloc.se/blog/zgc-softma…

Thanks for the advice. I'm stuck on 11 until the next LTS release but I'll definitely be trying ZGC next year. (ZGC is in 11 but still marked experimental, and I'm conservative about making changes.)

Shenandoah might help you. See my other comment for more details:

https://news.ycombinator.com/item?id=24571054

Re: Java Turns 25 – Whats Next? [pdf]

#283

Earlier quoted context omitted.

That's not always true. Most of the time when Java uses a ton of memory it's because people use the default memory settings. If you tell Java to use up to 90% of system RAM, it will. Garbage collection is expensive so it will delay until memory is depleted. This is a different GC design than V8 and Go, which use older collector designs with high overhead. They need to collect very frequently because their stop the wo…

All OK except when you need the same level of performance for those 0.001% of requests when the GC kicks in and takes the response time outside acceptable limits. Due to this reason alone, my company is planning to move off a popular Java based API gateway and to a C++ envoy side car implemented service mesh. And I am wondering if this is really worth it.

Shenandoah might help you. See my other comment for more details:

https://news.ycombinator.com/item?id=24571054

Re: Java Turns 25 – Whats Next? [pdf]

#284
post #76
post #73

Earlier quoted context omitted.

With project Valhalla (value types), as well as the GC improvements in recent JDK releases (e.g. they are much more aggressive in releasing unused heap back to the OS), this should be a much smaller issue going forward. On another note, I'm not aware of other freely available GCs in other languages that are able to easily scale to multi-GB/TB scale memory usage. A while ago, I benchmarked an open source key/value gol…

> e.g. they are much more aggressive in releasing unused heap back to the OS By aggressive you mean they actual do that now right? As far as I know before ZGC no gc did that and they're still back porting that feature to G1 right? Edit: I'm actually quite pleased with ZGC I have the eclipse language server use it and my editors memory usage on average is so much lower.

Shenandoah is coming to OpenJDK 11. See my other comment for more details:

https://news.ycombinator.com/item?id=24571054

Re: Java Turns 25 – Whats Next? [pdf]

#285

Java might be the most successful programming language. It is a solid choice among many different fields. It is used on huge infrastructure projects (Apache Foundation), governments, big tech companies such as amazon, ibm, google, apple for many large scale services. It can do web, ml, GUIs, it's still strong among academics. On top of that it offers a great programming experience with excellent IDE support and it's…

In my opinion, Java as a web language is good when you don't need to really understand what's happening (like in low-traffic situations). If concurrency isn't an issue, then the massive amount of libraries can help you a lot. In high-traffic environments, that ignorance punishes you. I've always felt Java and the JVM are of the mindset that you need a Ph.D. to even understand how it works or how to configure it, and…

> In my opinion, Java as a web language is good when you don't need to really understand what's happening (like in low-traffic situations). If concurrency isn't an issue, then the massive amount of libraries can help you a lot.

Not sure how to interpret this comment.. If high concurrency and high performance matter, that is precisely where Java shines. The only other reasonable option would be C++ but it brings so much pain with it that Java is the way to go.

If traffic is low and performance doesn't matter (which is most sites), then sure, use whatever favorite scripting language.

Re: Java Turns 25 – Whats Next? [pdf]

#286

Java might be the most successful programming language. It is a solid choice among many different fields. It is used on huge infrastructure projects (Apache Foundation), governments, big tech companies such as amazon, ibm, google, apple for many large scale services. It can do web, ml, GUIs, it's still strong among academics. On top of that it offers a great programming experience with excellent IDE support and it's…

The main problem with Java is its concurrency model, which gives incentive to the creation of threads that fight for resources and introduce bugs. This seemed a wise choice in the 90s, but as concurrency has increased several-fold in the last 25 years, the model cannot scale to real software needs. It is the Java equivalent to pointers in C.

> the model cannot scale to real software needs

Most of the highest performance server code across many industries in written in Java. So...

I wonder what do you consider could possibly compete with Java in this space?

Post reply on HN