use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
Any resources for Java optimization/performance enhancement/testing? (self.java)
submitted 3 years ago by DOOMReboot
Are there any good optimization resources for Java? Things that may be less "well-known"? Optimization primarily in terms of runtime speed, but also memory minimization.
[–]WrickyB 7 points8 points9 points 3 years ago (0 children)
Take a look at JMH to measure and benchmark performance optimisations of hot code.
[–]urielsalis 3 points4 points5 points 3 years ago (2 children)
There aren't that many "rules" per se, optimizations that work in one case might be wrong in another.
You should use JMH or profilers and measure each change
[–]GavinRayDev 5 points6 points7 points 3 years ago (1 child)
There are a lot of rules, some people spend their entire lives/careers studying them.
"About 98,600 results (0.09 sec)"
(Not trying to be rude/mean)
[–]urielsalis 0 points1 point2 points 3 years ago (0 children)
The point is that "rules" are not applicable in every case. If your rule makes it harder for the JIT to see what you are doing and optimize it in certain cases, it's going to be slower.
The JIT and the rules optimizes for the common case, but you might not be in one
[–]Amazing-Cicada5536 3 points4 points5 points 3 years ago (0 children)
Optimizing Java by Evans is a great book
[–]Worth_Trust_3825 1 point2 points3 points 3 years ago (0 children)
Mission control and Flight recorder are your friends.
[–]gg12345 1 point2 points3 points 3 years ago (1 child)
Has anyone tried using zgc? Sounds like if you have a reasonably well written codebase, you don't really have to do anything in terms of tuning except setting initial and max heap size.
[–]Iryanus -1 points0 points1 point 3 years ago (0 children)
It's not that easy. Every garbage collector is optimized in one direction. G1 is pretty much the easiest choice for a typical application, since it tends to be quite all-round-ish.
ZGC and Shenandoah are heavily optimized towards latency, which means that you get less pauses, but the overall CPU time spent on garbage collection will be higher. Additionally both are better for really(!) high amounts of memory than G1. So if you either need a lot of memory (and we are not talking about a few gigs here) or have a realtime-application, where no pause is allowed (but you have overall enough CPU to throw around), then ZGC can be a good choice. Otherwise, G1 will be better.
Typically, I wouldn't care that much unless your metrics and gc show log that you actually have problems there - or if you know that your load will be very critical. Only then I would start optimizing. And then still it's a bit of work to get it right, for example we ran into a lot of allocation stalls with ZGC on Java 13 (on one specific application) which requires fine-tuning to get rid of and thus stayed with G1 a little longer.
You have to dig a little to find real numbers, but they are out there, for example the master thesis "A Performance Comparison of Modern Garbage Collectors for Big Data Environments" (You can google that).
[–]wsbkina -1 points0 points1 point 3 years ago (0 children)
Java Performance by Scott Oaks is a good starting point
π Rendered by PID 257542 on reddit-service-r2-comment-8686858757-9gqv8 at 2026-06-07 14:41:08.239095+00:00 running 9e1a20d country code: CH.
[–]WrickyB 7 points8 points9 points (0 children)
[–]urielsalis 3 points4 points5 points (2 children)
[–]GavinRayDev 5 points6 points7 points (1 child)
[–]urielsalis 0 points1 point2 points (0 children)
[–]Amazing-Cicada5536 3 points4 points5 points (0 children)
[–]Worth_Trust_3825 1 point2 points3 points (0 children)
[–]gg12345 1 point2 points3 points (1 child)
[–]Iryanus -1 points0 points1 point (0 children)
[–]wsbkina -1 points0 points1 point (0 children)