JVM architecture – fast, effective, 30 mins tutorial

Long time, no post. As a warm-up, we suggest watching 30 minutes long tutorial, which explains JVM architecture. Prepare Your pencils, as Ranjith Ramachandran’s tutorial is packed with a lot of useful information. Do not forget to check out his channel too!

“Understanding the Memory Usage of Your Application” by Oracle Learning Library

Great lesson about JAVA and JVM memory usage. Not our tutorial, but – we strongly recommend You to watch it. Released in 2013, still, time did not affect it much.  The structure of the whole lesson, the amount of important information, yet provided in a very convenient way makes it really good. Furthermore, we recommend You to prepare notes, as each minute is packed with tons of JAVA knowledge. The video touches the subject of efficient data handling, regarding different types of collections, briefly. You can also learn about the internal architecture of JVM 32/64 bits, native heap and more.

Enjoy! And thanks Oracle Learning Library for putting this gem online.

“From Java Code to Java Heap: Understanding the Memory Usage of Your Application” by Oracle Learning Library:

Source: https://www.youtube.com/watch?v=FLcXf9pO27w

Merge Sort Algorithm in JAVA

If You are interested in general purpose, common sorting algorithm, I do recommend You to take a look at merge sort algorithm. The type of this algorithm is, of course, divide and conquer. Briefly – You are going to take an input (list, array) and divide it into halves as many times as possible until You reach 1-element sublist. Then, You need to merge it again. After it finished, final output is the sorted input. Read more for the code example, visualization and full recipe. (..)

What is the default capacity of ArrayList in JAVA?

  • Question: What is the default capacity of java.util.ArrayList?
  • Answer: It is exactly 10.

Why not any power of 2? Well, Sun engineers believed after long and costly research, that 10 is the best number You can pick. What is more curious, default initial capacity of java.util.HashMapis 16, which makes more sense.

What do You think, something is missing here? Is 10 really a perfect fit for array type collections?