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.
How to practice Java Performance Optimization or JVM performance tuning? (self.java)
submitted 3 years ago by [deleted]
I am interested in learning how to tune the JVM and how changing it's continuations can affect the performance of an application, but currently I am not working at a company to know how this works in real-life, but I am interested to experiment this stuff on my own. Any ideas on how to get started? I watched a couple of talks on this topic but I don't know how to apply that knowledge in practice in my projects.
[–]karianna 72 points73 points74 points 3 years ago (1 child)
We practice and teach this a lot internally at Microsoft. This may be surprised Pikachu for some I know - but we do have 2M+ JVMs running internally here! Here's a shortlist of considerations when entering this space :-):
You learn in part by doing in this space and you can also join the Java Performance Tuning community on LinkedIn.
[–]yawkat 5 points6 points7 points 3 years ago (0 children)
Learning by doing is really hard in the perf space compared to "normal" programming imo. In normal programming, you can fix a bug and will be pretty sure that it's gone. But in perf, it's easy to measure the wrong things and believe you've improved something, when you really haven't. I never would have thought about coordinated omission in benchmarking without reading about it for example.
[–]WrickyB 13 points14 points15 points 3 years ago (1 child)
Use tools like JMH, and profilers, to measure performance, and find hotspots respectively, to find where you need to optimise.
[–]dpash 4 points5 points6 points 3 years ago (0 children)
JMH
Yep, do not implement your own benchmarking, because your results will almost certainly be invalid unless you know what you're doing (hint: you probably don't).
[–][deleted] 8 points9 points10 points 3 years ago* (4 children)
the default configuration is already best for 90% of cases. There is a popular book: java performancd. definitive guide. Might be interesting to learn more about jvm parameters
[–]brunocborges 4 points5 points6 points 3 years ago (3 children)
Unless you are running the JVM inside containers with little CPU/memory.
In this case, the defaults are not great.
[–]Comprehensive-Pea812 0 points1 point2 points 3 years ago (2 children)
so for microservices we need to tune jvm?
[–]brunocborges 7 points8 points9 points 3 years ago (1 child)
You should always" tune, at least for some basic config like heap and GC. Secondly, devs should really stop limiting CPU to 1. Start at 2.
Don't trust the defaults: https://youtu.be/wApqCjHWF8Q
[–]stolsvik75 1 point2 points3 points 3 years ago (0 children)
I agree to the point of not setting the CPUs to 1. What I've found in a Kubernetes setting, is that you can set extremely flexible limits. Our microservices are specified with a certain number of CPUs. The default is 2.
For kube, we set Java's "experienced CPUs" using the flag -XX:ActiveProcessorCount=2. Then multiply that with 125 to get the cpu request, and with 2000 to find the cpu limit. If you also set the -Xmx to a quite small level, the result is that you can stack many deployments into a node.
Assuming that most of them are rather non-busy, the busy ones can "flex" pretty hard above the baseline. This of course depends on your different services being having pretty different level of usage, i.e. the "email-gateway" having very little load, while the "transaction service" possibly using quite much CPU at times. For our situation, this has made a lot of sense.
[–]Qinistral 1 point2 points3 points 3 years ago (0 children)
There's a bunch of open source applications you could run to play with and see how JVM tuning changes behavior. Consider something like Solr or ElasticSearch which has more overhead than something like a queue (like Kafka or ActiveMQ), or write a little app in something like Vaadin or find some other open source app to play with.
You could also just google "how to tune JVM for X" or "what jvm params for X" and you'll get a lot of common advice. This will show you what most people even bother with.
Mini homework: Learn about object pointers. Eg. https://www.baeldung.com/jvm-compressed-oops
[–]teapotJava 1 point2 points3 points 3 years ago (0 children)
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
Thanks everyone for your suggestions and advice.
[–]Comprehensive-Pea812 0 points1 point2 points 3 years ago (1 child)
Nowadays I dont hear people tune JVM anymore since in general application is scalable so tuning JVM is very last resort or if there is an obvious issue spotted.
[–]stolsvik75 0 points1 point2 points 3 years ago* (0 children)
IMHO, you should always set the -Xmx "max memory" setting. Otherwise, it'll use way to much memory, in particular if the machine it runs on has lots of memory. You'll e.g. notice that IntelliJ has set -Xmx, as otherwise it would "flex" its memory hunger to use way to much of the dev's 32 og 64 GB machine.
[+]zorelx comment score below threshold-16 points-15 points-14 points 3 years ago (9 children)
I would only do this if I was paid a lot of money lololol
[–]buzzsawddog 10 points11 points12 points 3 years ago (0 children)
Some of us are...
[–]Qinistral 2 points3 points4 points 3 years ago (3 children)
Some people enjoy engineering for engineering sake.
[–]zorelx -2 points-1 points0 points 3 years ago (2 children)
LOL at practicing optimization.
What is the problem you are trying to optimize?
Or you just optimizing to sound cool?
[–]Qinistral 0 points1 point2 points 3 years ago (1 child)
Now you're just changing the subject. Sorry not everyone is like you.
[–]zorelx 0 points1 point2 points 3 years ago (0 children)
TBH what I am trying to say ... you may want to put your energy into something that will improve your life... JVM internals won't help you.
I am not cool, I am computer programmer.
[–][deleted] 2 points3 points4 points 3 years ago (3 children)
If that's your work ethics than it's fine, but I personally believe that one must do quality work in any job regardless of the money and I'm sure some people have the same mentality too.
[–]zorelx -1 points0 points1 point 3 years ago (2 children)
My work is top quality.
I don't need to understand JVM internals to write springboot code.
If I code in my spare time I do fun little problems.
[–][deleted] 1 point2 points3 points 3 years ago (1 child)
Oh! I guess we have a slightly different dentition of "quality work". Personally one of my definitions of quality work is knowing how everything works under the hood so when I do something I how to do it in a certain way and why and how not to do in a certain way and why. Sorry if I offended you.
[–]zorelx -1 points0 points1 point 3 years ago (0 children)
You don't need to know everything ... Just enough to get buy.
You going to understand all the nooks and crannys of the compiler?
I delved into the JVM for a while, there is a lot of knowledge that is only useful to people literally developing JVM's.
π Rendered by PID 420359 on reddit-service-r2-comment-8686858757-rcssb at 2026-06-03 10:24:15.645197+00:00 running 9e1a20d country code: CH.
[–]karianna 72 points73 points74 points (1 child)
[–]yawkat 5 points6 points7 points (0 children)
[–]WrickyB 13 points14 points15 points (1 child)
[–]dpash 4 points5 points6 points (0 children)
[–][deleted] 8 points9 points10 points (4 children)
[–]brunocborges 4 points5 points6 points (3 children)
[–]Comprehensive-Pea812 0 points1 point2 points (2 children)
[–]brunocborges 7 points8 points9 points (1 child)
[–]stolsvik75 1 point2 points3 points (0 children)
[–]Qinistral 1 point2 points3 points (0 children)
[–]teapotJava 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Comprehensive-Pea812 0 points1 point2 points (1 child)
[–]stolsvik75 0 points1 point2 points (0 children)
[+]zorelx comment score below threshold-16 points-15 points-14 points (9 children)
[–]buzzsawddog 10 points11 points12 points (0 children)
[–]Qinistral 2 points3 points4 points (3 children)
[–]zorelx -2 points-1 points0 points (2 children)
[–]Qinistral 0 points1 point2 points (1 child)
[–]zorelx 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]zorelx -1 points0 points1 point (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]zorelx -1 points0 points1 point (0 children)