JVM Optimization in Real Systems

A Spring Boot application unexpectedly surged in JVM memory usage from 8GB to 61GB without any deployment or configuration changes. By diagnosing a ZipFile$Source memory leak with yCrash, the team identified excessive caching leading to the leak. By disabling caching and restarting the app, they reduced memory usage to 4GB effectively.

Top 5 Java Performance Problems

Java is a popular programming language that powers several mission critical applications all over the world. In this post let's discuss some of the commonly confronted performance problems by Java applications and potential solutions to solve them. Video In this video, we explored the most common issues that impact Java applications in production environments. Our... Continue Reading →

Introduction to ExecutorService in Java

The article discusses the challenges of working directly with thread instances in Java and introduces the Concurrency API, specifically the ExecutorService interface, which simplifies thread management. It covers creating single-threaded and pool-threaded executors, submitting tasks, and the importance of properly shutting down the executor to prevent memory leaks.

Chaos Engineering – Storage Saturation

Production environments frequently face space shortages due to growing disk usage by files like logs, databases, and output files. Failing to monitor and manage these files can lead to application crashes. The article explores simulating disk storage issues, offering a sample program, and strategies for diagnosing storage saturation, including manual and automated approaches using monitoring tools.

Chaos Engineering – Network Lag

The article discusses the impact of network delays on application performance and presents a method to simulate network lag using BuggyApp as a proxy server. It provides a sample program to introduce delays in server responses and explains manual and automated approaches to diagnose network issues. The article highlights the importance of addressing network performance problems in chaos engineering.

Java NIO – OutOfMemoryError

Java NIO allows high-performance non-blocking I/O, enhancing concurrency and efficiency. However, running a Spring Boot application with Java 11 led to frequent 'OutOfMemoryError' issues. Upgrading to Java 17 and increasing Direct Buffer Memory allocation improved performance, allowing for significantly more connections before errors occurred. Solutions include optimizing memory size or upgrading Java versions.

Optimizing the Capacity of a HashMap

This article discusses how to optimize memory allocation in HashMaps by understanding the differences between allocation and mapping capacity. It emphasizes the importance of choosing the correct initial capacity, ideally a power of two, to mitigate space overhead and prevent performance degradation. Several formulas for calculating proper capacity are reviewed.

Actions on OutOfMemoryErrors

OutOfMemoryErrors in applications occur when memory allocation fails. This article discusses effective practices for analyzing such errors, including automatic heap dumps and using JVM parameters. It highlights script usage for automatic actions upon encountering errors and emphasizes the importance of proactive monitoring and automated incident reporting to reduce application downtime.

Up ↑