Postingan

Menampilkan postingan dengan label JVM Internals

Top 5 Java Performance Tuning Books for Experienced Programmers - Best of Lot, Must read

Gambar
You might be thinking, why should a Java developer read a book on Performance tuning? When I first faced this question a long time back, I thought I will do it later, but I never got back to that for a long time. I realize my mistake of having a lack of knowledge on memory measurement, JVM tuning, and finding bottleneck only when I faced severe performance and scalability issues on our mission-critical, server-side financial application written in Java. It's true that when you really need it, you learn most, but those times are not the best time to learn fundamentals, in fact, those times are to apply and correct your misunderstanding. This is why I am sharing these Java performance books to all Java programmers and suggesting them to take some time and go through at least one book in full. By the way, these books are in addition to my 5 must-read books for Java programmers, which deals with all other topics in Java. If you haven't read them yet, make sure you check them as we...

Top 5 Courses to learn JVM Internals, Memory Management, GC and Performance Tuning in Java

Gambar
For a senior Java developer, it's essential to know how JVM works and how to troubleshoot issues with respect to memory, most notably memory leaks in Java applications and servers like Tomcat. You might be thinking, how come memory leaks in Java? Isn't memory is managed by JVM and Garbage collector? Well, that's true, but poor coding or just a bit of carelessness can cause memory leaks in Java. If you don't know about how to configure JVM, troubleshoot memory-related problems on the heap, and stack, you will struggle at a higher level. That's why it's essential for experienced Java developers to spend some time learning these advanced skills as their experience grows. If you are thinking on the same line and interested in learning JVM internals, memory management, GC and Performance tuning this year then you have come to the right place. In the past, I have shared some of the books and articles to learn about JVM internals and Garbage collection and today, I...

Improving Performance of java application

This is a big topic to discuss as there are many approaches which involve analyzing performance of an application starting from profiling application to finding the bottleneck. here I am putting some of the basic tricks for improving performance which I learned in my early days in java , I will keep posted some approach , experience on performance improvement as and when time allows. for now here are naive's tips for making your program run faster. 1. Use bit shift operator for multiplying and divide by 2 , computers are very fast with the bitwise operation. 2. Use StringBuffer in place of the string if you are doing lots of string manipulation it will reduce memory by avoiding creating lots of string garbage. If you are using java5 then consider StringBuilder but that is not synchronized so beware. 3. try to make variable , class , method final whenever possible that allows compiler to do lots of optimization e.g. compile time binding so you will get faster output. 4. static metho...

10 Garbage Collection Interview Questions and Answers in Java Programming

Gambar
GC Interview Questions Answer in Java Garbage collection interview questions are very popular in both core Java and advanced Java Interviews. Apart from  Java Collection and Thread many tricky Java questions stem Garbage collections which are tough to answer. In this Java Interview article I will share some questions from GC which is asked in various core Java interviews. These questions are based upon the concept of How Garbage collection works, Different kinds of Garbage collectors, and JVM parameters used for garbage collection monitoring and tuning. As I said GC is an important part of any Java interview so make sure you have good command in GC. One more thing which is getting very important is the ability to comprehend and understand Garbage collection Output , more and more interviewer are checking whether the candidate can understand GC output or not. During Java interview, they may provide a snippet of GC output and ask various questions based on that like Which...

10 Examples of HotSpot JVM Options in Java

Gambar
There are hundreds of JVM parameters or JVM Options exists inside sun JDK and its virtually impossible to keep track of every single JVM option and based on my experience we don't even use most of JVM flags except couple of important JVM option related to java heap size, java options for printing garbage collection details and most likely JVM switches for setting up remote debugging in Java. but there are many other useful category of JVM parameters which you at least like to be familiar even if not intending to use it more frequently. In this article we will see examples of 10 different categories of JVM parameter which I found useful and use more frequently than other. I would recommend to get a full knowledge of what does a particular JVM options does by referring official list of JVM options. JVM parameters in Java On the basis of how we specify JVM option it can be divided into two parts , JVM Options which starts with –X and those which starts with -XX: 1) JVM Options th...