Understanding Java Buffer Pool

The buffer pool space is located outside of the garbage collector-managed memory. It’s a way to allocate native off-heap memory. What’s the benefit of using buffer pools? To answer this question, let’s firstly learn what byte buffers are.   Byte Buffer Non-Direct Buffer java.nio package comes with the ByteBuffer class. It allows us to allocate both direct…

Read more...

Profiling in Production

If you ever had some serious issues with a performance of your Java application, most probably you know how valuable thread profiling can be. But do you know which profiler you should use?   There are two basic techniques used by profilers – sampling and instrumentation.   Sampling Profilers A sampling profiler involves periodically asking…

Read more...

Why Server If It’s Not a Server?

Have you ever wondered why when you type java -version, you usually get something like that: java version “1.8.0_131” Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)   Why Server VM? For JVM, some machines are considered to be “client-class” and some are “server-class”. If the given machine…

Read more...

What Causes OutOfMemoryError?

OutOfMemoryError might be thrown when one of the following circumstances occurs: JVM has run out of native memory Java heap is out of memory PermGen or Metaspace has run out of memory JVM spent too much time trying to collect the garbage The root cause of OutOfMemoryError can be usually deducted from the error message. Let’s…

Read more...

PermGen and Metaspace

PermGen is an abbreviation for Permanent Generation and it’s a special heap space which is separate from the main Java heap where JVM keeps track of metadata of the classes which have been loaded. In Java 8 PermGen has been renamed to Metaspace – with some subtle differences. From our perspective, it is important to…

Read more...