Live data from Hacker News

Java Turns 25 – Whats Next? [pdf]

oracle.com

131–140 of 286 posts

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

#131

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…

I'll shamefully admit that I have been running and writing JVM based services for years and I didn't know this. I thought that the fixed memory overhead for a simple JVM service was simply higher than with CPython as a fact of life. There are times when I'd happily trade more frequent GC pauses for a smaller per-process memory footprint. How do you find a reasonably small Xmx that doesn't lead to OutOfMemoryError exc…

> 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-softmaxheapsize

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 is what V8 and Go's collectors were designed to avoid. They have more overhead from collecting frequently, but low pauses. With the new Java collectors you get the best of both worlds.

You can set heap ratios and such for older collectors to decrease Java memory use with those, but IMO you're better off using ZGC and uncommit these days

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

#132

Earlier quoted context omitted.

Other than Effective Java, I recommend looking at some of the Google libraries, specifically Guava [1] and Guice [2] for dependency injection. Java is fundamentally a slow adopter of new techniques (it just got lambdas in JDK 8), but a lot of the Google libraries fill in the gaps. Note that if you are learning Java for Android development, that's a whole different sub-discipline. In that case I recommend the Android…

> (it just got lambdas in JDK 8) Interesting use of the word 'just'. At the risk of making readers feel old... Java 8 was released _6 and a half years ago_.

Point taken. For some reason, a lot of the code work i've encountered is tied to JDK 8. Might be due to it having LTS until 2018 [1].

It could be anecdotal, but I've found in practice vendors and companies are conservative about their JDK upgrades. I haven't seen anything prior to JDK 6 in a while, but I don't think the upgrade cycle is as fast as say, python minor version upgrades.

[1] https://en.wikipedia.org/wiki/Java_version_history

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

#133

Top point talks about targeting data scientists. It would be interesting seeing what that means in their mind. Based on the current state of affairs oracle and the jvm seem very far away from mainstream ML

There's a lot of enterprise data science being done with Java/Scala and the Hadoop/Spark ecosystem. MXNet also makes deep learning a first-class citizen in Java, but yes the research community is firmly entrenched in Python atm. I see JDK languages as being in a decent spot for deploying ML/DL, and maybe an "emerging" language for training DL models. Folks like Jeremy Howard have increasingly been expressing growing…

The Tensorflow Java project is alive and well. The next version of the API based on TF 2 is coming out soon. (Full disclosure, I'm a member of the SIG that's building it). I'm a firm believer in the utility of type systems for building machine learning projects.

https://github.com/tensorflow/java

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

#134

Slightly tangential, but due to a new job I'll have bite the bullet and learn Java. When googling tutorials, I see the same material I found 12 years ago. A lot must have happened since then. What's a good resource to learn Java for somebody who already knows how to program? I'm interested in ecosystem, tooling, best practices, common pitfalls etc.

Other than Effective Java, I recommend looking at some of the Google libraries, specifically Guava [1] and Guice [2] for dependency injection. Java is fundamentally a slow adopter of new techniques (it just got lambdas in JDK 8), but a lot of the Google libraries fill in the gaps. Note that if you are learning Java for Android development, that's a whole different sub-discipline. In that case I recommend the Android…

Knowing what Guava offers is useful, but I try to avoid it, especially in libraries, because it has a history of breaking changes. The Apache Commons libraries are versioned better and a little more focused.

Protobuf (another Google Java product) also made big breaking changes in libraries between 2 and 3.

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

#135

I've been programming Java since 1998 or so, and this may be surprising to some on here - but I still like it! Here are the upsides in my mind, and as with all these things keep in mind - nothing's perfect! Everything has tradeoffs and I am making no absolute statements. Anyway, in no particular order: - Performance. It's possible for Java to be within 50-98% of the speed of even the most hand tuned native code, whic…

> OOP

If you need to couple state with logic, OOP is what you want.

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

#136
post #117

Earlier quoted context omitted.

I use typescript a lot. It's way better than JS but the type erasure problem is far worse than Java. Essentially all types are erased, so bugs where typings don't match what you expect and everything blows up are common. This isn't possible in Java because it's statically typed at runtime. JS also uses several times more memory, is slower, and has a terrible (non existing) threading model. Yes you can run multiple in…

> bugs where typings don't match what you expect and everything blows up are common > the only overhead is making sure objects were passing around match on both ends Seem like is it a big deal based on the first sentence. I've never been convinced of the single language argument. Sharing code between frontend and backend sounds good but as in practice there's little overlap... models have subtle differences, there's…

This library looks great! For cross language comms you can also use gRPC to avoid writing objects for both sides. We're not using it company wide but so far it works as advertised, minus the annoyance of having to use gRPC proxy to web endpoints

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

#137
post #38

Earlier quoted context omitted.

I would recommend against guava in any modern form of Java. It doesn't provide much over the standard library. As for guice, my preference for reflective runtime injection is Weld since it's the standard reference implementation.

I would still recommend Guava for immutable collections, and for the caching classes, both of which are much better than trying to piece things together on your own. There are a lot of features that have been subsumed into the JDK, and you should usually prefer the JDK implementation where available. Guava has deprecated the redundant functionality, so if you pay attention to your IDE you will be fine.

I'm not really obsessed with immutability. Does Collections.unmodifiable{List,Set,Map,Collection} not do it for you?

I did forget about the cache's though! Good call.

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

#138
post #48

I'm surprised that GraalVM is not mentioned. I have strong suspicions that Oracle is lining up Graal to become the next default JVM, after watching some talks from core developers describing how fragile the Hotspot codebase has become. Graal would be a good way to encourage ML, given it has language support for Python. Perhaps Graal is just not ready for Oracle to show all of their cards at this point. Or perhaps my…

They still need some more time with GraalVM. Currently you need Microsoft's C++ Compiler in order to use GraalVM on Windows. They will need time to polish these things... But GraalVM performance is already on par with HotSpot - with better startup times!

> Currently you need Microsoft's C++ Compiler in order to use GraalVM on Windows

No need for xcode on os x or gcc on Linux, or clang on bsds?

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

#139

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…

Java is still my default language after so many years (even though through Clojure). I think Java's biggest advantage is the JVM though, if it had an ML programming language on the top without null and proper interfacing to Java packages I would never look at anything else. Just like .NET has F#.

What's your opinion of Scala?

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

#140

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…

And it gave us Minecraft of course
Post reply on HN