eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

eBook – Mockito – NPI EA (tag = Mockito)
announcement - icon

Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code.

Get started with mocking and improve your application tests using our Mockito guide:

Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Reactive – NPI EA (cat=Reactive)
announcement - icon

Spring 5 added support for reactive programming with the Spring WebFlux module, which has been improved upon ever since. Get started with the Reactor project basics and reactive programming in Spring Boot:

>> Join Pro and download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Jackson – NPI EA (cat=Jackson)
announcement - icon

Do JSON right with Jackson

Download the E-book

eBook – HTTP Client – NPI EA (cat=Http Client-Side)
announcement - icon

Get the most out of the Apache HTTP Client

Download the E-book

eBook – Maven – NPI EA (cat = Maven)
announcement - icon

Get Started with Apache Maven:

Download the E-book

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

eBook – RwS – NPI EA (cat=Spring MVC)
announcement - icon

Building a REST API with Spring?

Download the E-book

Course – LS – NPI EA (cat=Jackson)
announcement - icon

Get started with Spring and Spring Boot, through the Learn Spring course:

>> LEARN SPRING
Course – RWSB – NPI EA (cat=REST)
announcement - icon

Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:

>> The New “REST With Spring Boot”

Course – LSS – NPI EA (cat=Spring Security)
announcement - icon

Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.

I built the security material as two full courses - Core and OAuth, to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project.

You can explore the course here:

>> Learn Spring Security

Course – LSD – NPI EA (tag=Spring Data JPA)
announcement - icon

Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot.

Get started with Spring Data JPA through the guided reference course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – LJB – NPI EA (cat = Core Java)
announcement - icon

Code your way through and build up a solid, practical foundation of Java:

>> Learn Java Basics

Partner – LambdaTest – NPI EA (cat= Testing)
announcement - icon

Distributed systems often come with complex challenges such as service-to-service communication, state management, asynchronous messaging, security, and more.

Dapr (Distributed Application Runtime) provides a set of APIs and building blocks to address these challenges, abstracting away infrastructure so we can focus on business logic.

In this tutorial, we'll focus on Dapr's pub/sub API for message brokering. Using its Spring Boot integration, we'll simplify the creation of a loosely coupled, portable, and easily testable pub/sub messaging system:

>> Flexible Pub/Sub Messaging With Spring Boot and Dapr

1. Overview

Sometimes writing code that just runs isn’t enough. We might want to know what goes on internally, such as how memory is allocated, the consequences of using one coding approach over another, the implications of concurrent executions, areas to improve performance, etc. We can use profilers for this.

A Java Profiler is a tool that monitors Java bytecode constructs and operations at the JVM level. These code constructs and operations include object creation, iterative executions (including recursive calls), method executions, thread executions, and garbage collections.

In this tutorial, we’ll explore the main Java Profilers: JProfiler, YourKit, Java VisualVM, the Netbeans Profiler, and the IntelliJ Profiler.

2. JProfiler

JProfiler is a top choice for many developers. With an intuitive UI, JProfiler provides interfaces for viewing system performance, memory usage, potential memory leaks, and thread profiling.

With this information, we can easily see what we need to optimize, eliminate, or change in the underlying system.

This product requires the purchase of a license, but also offers a free trial.

Here’s what the JProfiler’s interface looks like:

jprofiler overview probingJProfiler overview interface with features

Like most profilers, we can use this tool for both local and remote applications. This means that it’s possible to profile Java applications running on remote machines without having to install anything on them.

JProfiler also provides advanced profiling for both SQL and NoSQL databases. It provides specific support for profiling JDBC, JPA/Hibernate, MongoDB, Casandra, and HBase databases.

The below screenshot shows the JDBC probing interface with a list of current connections:

jprofiler database probing 1JProfiler database probing view

If we’re keen on learning about the call tree of interactions with our database and seeing connections that may be leaked, JProfiler nicely handles this.

Live Memory is one feature of JProfiler that allows us to see current memory usage by our application. We can view memory usage for object declarations and instances, or for the full call tree.

For the allocation call tree, we can choose to view the call tree of live objects, garbage-collected objects, or both. We can also decide if this allocation tree should be for a particular class or package, or all classes.

The screen below shows the live memory usage by all objects with instance counts:

jprofiler live memoryJProfiler live memory view

JProfiler supports integration with popular IDEs, such as Eclipse, NetBeans, and IntelliJ. It’s even possible to navigate from snapshot to source code.

3. YourKit

YourKit Java Profiler runs on many different platforms, and provides separate installations for each supported operating system (Windows, MacOS, Linux, Solaris, FreeBSD, etc.).

Like JProfiler, YourKit has core features for visualizing threads, garbage collections, memory usage, and memory leaks with support for local and remote profiling via ssh tunneling.

YourKit offers paid licenses for commercial use, which include a free trial, and lower cost or free licenses for non-commercial use.

Here’s a quick look at the memory profiling results of a Tomcat server application:

yourkit tomcat profiling memoryYourKit Java Profiler memory profiling of Tomcat server application

YourKit also comes in handy when we want to profile thrown exceptions. We can easily find out what types of exceptions were thrown, and the number of times each exception occurred.

YourKit has an interesting CPU profiling feature that allows focused profiling on certain areas of our code, such as methods or subtrees in threads. This is very powerful, as it allows for conditional profiling through its what-if feature.

Figure 5 shows an example of the thread-profiling interface:

yourkit threads profilingFigure 5. YourKit Java Profiler threads profiling interface

We can also profile SQL and NoSQL database calls with YourKit. It even provides a view for actual queries that were executed.

Though this isn’t a technical consideration, the permissive licensing model of YourKit makes it a good choice for multi-user or distributed teams, as well as for single-license purchases.

4. Java VisualVM

Java VisualVM is a simplified, yet robust profiling tool for Java applications. This is a free, open-source profiler.

This tool was bundled with the Java Development Kit (JDK) up to JDK 8, but was removed in JDK 9, and is now distributed as a standalone tool: VisualVM Download.

Its operation relies on other standalone tools provided in the JDK, such as JConsole, jstat, jstack, jinfo, and jmap.

Below we can see a simple overview interface of an ongoing profiling session using Java VisualVM:

visualvm overviewJava VisualVM local tomcat server app profiling

One interesting advantage of Java VisualVM is that we can extend it to develop new functionalities as plugins. We can then add these plugins to Java VisualVM’s built-in update center.

Java VisualVM supports local and remote profiling, as well as memory and CPU profiling. Connecting to remote applications requires providing credentials (hostname/IP and password as necessary), but doesn’t provide support for ssh tunneling. We can also choose to enable real-time profiling with instant updates (typically every 2 seconds).

Below we can see the memory outlook of a Java application profiled using Java VisualVM:

visualvm sample memoryJava VisualVM memory heap histogram

 

With the snapshot feature of Java VisualVM, we can take snapshots of profiling sessions for later analysis.

5. NetBeans Profiler

The NetBeans Profiler is bundled with Oracle’s open-source NetBeans IDE.

While this profiler shares a lot of similarities with Java VisualVM, it’s a good choice when we want everything wrapped in one program (IDE + Profiler). All the other profilers discussed above provide plugins to enhance IDEs integration.

The below screenshot shows an example of the NetBeans Profiler interface:

netbeans telemetry viewNetbeans Profiler telemetry interface

Netbeans Profiler is also a good choice for lightweight development and profiling. It provides a single window for configuring and controlling the profiling session and displaying the results. It provides the unique feature of knowing how often garbage collection occurs.

6. IntelliJ Profiler

IntelliJ Profiler is a simple, yet powerful tool for CPU and memory allocations profiling. It combines the power of two popular Java profilers: JFR and Async profiler.

While there are some advanced features, the main focus is on ease of use. IntelliJ Profiler allows us to get started in a few clicks without any kind of configuration, while providing helpful features to assist in our day-to-day development work.

As part of IntelliJ IDEA Ultimate, IntelliJ Profiler can be attached to a process with a single click, and we can navigate between a snapshot and the source code as if they were one. Its other features, like differential flame graphs, allow us to visually assess the performance of different approaches and get insight into the runtime operations quickly and efficiently:

IntelliJ Profiler works on Windows, Linux, and macOS.

7. Other Solid Profilers

Some honorable mentions here are Java Mission Control, New Relic, and Prefix (from Stackify). These have less market share overall, but definitely do deserve a mention. For example, Stackify’s Prefix is an excellent lightweight profiling tool, well-suited for profiling not only Java applications, but other web applications as well.

8. Conclusion

In this article, we discussed profiling and Java Profilers. We looked at the features of each Profiler, and what informs the potential choice of one over another.

There are many Java profilers available, with some having unique characteristics. The choice of which Java profiler to use, as we’ve seen in this article, is mostly dependent on a developer’s selection of tools, the level of analysis required, and the features of the profiler.

Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

Once the early-adopter seats are all used, the price will go up and stay at $33/year.

eBook – HTTP Client – NPI EA (cat=HTTP Client-Side)
announcement - icon

The Apache HTTP Client is a very robust library, suitable for both simple and advanced use cases when testing HTTP endpoints. Check out our guide covering basic request and response handling, as well as security, cookies, timeouts, and more:

>> Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

Course – LS – NPI EA (cat=REST)

announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

eBook Jackson – NPI EA – 3 (cat = Jackson)