How to generate an Heap Dump in Java

A heap dump is a snapshot of the Java Virtual Machine’s memory, capturing the state of objects and their relationships. Analyzing heap dumps aids in diagnosing memory-related issues, identifying memory leaks, and optimizing application performance. Let’s explore five different methods to generate a heap dump in Java. 1. Using jmap Command-Line Tool Step 1: Identify … Read more

Mastering Virtual Threads: A Comprehensive Tutorial

Virtual threads, also known as project Loom, are a new feature available in Java 21 that aims to provide lightweight, efficient, and scalable concurrency. They are designed to improve the performance and efficiency of concurrent applications by reducing the overhead associated with traditional thread-based concurrency. At the same time, they allow write asynchronous code in a much simpler way than reactive programming.

Read more

How to analyze large Java Heap Dumps

One critical tool in diagnosing memory-related issues is the Heap dump, a snapshot of an application’s memory at a particular point in time. However, as applications become larger and more intricate, heap dumps can also become massive and challenging to analyze. In this article, we will learn how to examine Heap Dump data even with lightly equipped hardware.

Read more

How to init an Array in Java made simple

In this comprehensive guide, we uncover the diverse techniques to init an array in Java, discussing basic and advanced approaches. Whether you’re diving into static or dynamic array creation, Arrays.copy or exploring data Streaming , this article equips you with the essential know-how to streamline your Java programming experience Static Array Initialization Static array initialization … Read more

Migrating from Java 8 to Java 17 with OpenRewrite

In this article we will discuss on how to migrate Java applications from Java 8 to Java 17 using the OpenRewrite migration plugin. At the end of this tutorial, you will learn which are most common challenges that you can face when upgrading to Java 17 Java 8 to Java 17 challenges In pure project … Read more

Parsing PDF in Java made simple

When it comes to parsing PDF files in Java, two popular libraries stand out: Apache Tika and Apache PDFBox. Both libraries provide powerful features for working with PDF documents, but they have different approaches and trade-offs. In this article, we will explore how to parse a PDF using each library and compare their pros and … Read more

Java 21 Unnamed Classes and Instance Main Methods

Java 21 introduces two language core features: Unnamed Java Classes and a new launch protocol which allows running Java classes in a simpler format. In this article we will cover in detail these new features explaining how they can simplify your daily Java coding.

Read more

Troubleshooting OutOfMemoryError: Direct buffer memory

An OutOfMemoryError: Direct buffer memory is a common error that Java developers encounter when working with applications that use large amounts of direct memory. Direct memory is allocated outside of the Java heap, and allows storing data that is needed by native libraries or I/O operations. In this tutorial, we will explore some common causes of this error and provide some troubleshooting steps.

Read more