This post discusses the use of ThreadLocal variables in Java and highlights their potential to cause memory leaks if not managed properly. An example program demonstrates how infinite thread creation can lead to OutOfMemoryError. It emphasizes the importance of capturing and analyzing heap dumps to diagnose leaks and recommends removing ThreadLocal values to prevent issues.
Memory Leak Due To Time Taking finalize() Method
This post discusses the implicit inheritance in Java from java.lang.Object and the limitations of the finalize() method which can lead to OutOfMemoryError. It highlights alternatives for resource cleanup, such as try-with-resources and java.lang.ref.Cleaner, and emphasizes the importance of proper implementation to prevent application failures.
Symptoms of Memory Leak
Memory leaks pose significant performance challenges, characterized by gradual memory increase, CPU spikes, degraded response times, and potential OutOfMemoryError. Symptoms evidencing memory leaks include continual memory growth post-garbage collection, high CPU usage due to frequent garbage collection, and application thread pauses leading to transaction timeouts. Early detection is crucial for remediation.
Not So Common Memory Leaks & How to fix them?
Excess memory usage can slow down applications or cause crashes due to memory leaks, often traceable through heap dump analysis. Common causes include slow finalizer methods, uncleared ThreadLocal variables, and mutated keys in collections. Using tools like HeapHero can help identify and resolve these issues efficiently.
How to Solve OutOfMemoryError: Kill Process or Sacrifice Child
This post discusses the Java OutOfMemoryError, with a focus on the rare 'Kill process (Java) or sacrifice child' error. It explains the causes, solutions, and ways to diagnose this issue. The post highlights the importance of knowing JVM memory areas and provides practical troubleshooting steps.
Optimizing the Capacity of a HashMap
Many of us know that allocating more memory than we need may negatively affect the performance of our application. Thus, creating the Lists using a constructor that takes a capacity may make a significant difference. However, this optimization step might not be so straightforward while using Maps. In this article, we’ll learn how to identify... Continue Reading →
Java SpringBoot – Performance Analysis and Tuning
SpringBoot is a widely used framework for building Java-based web applications and maintains a significant presence in the world of enterprise software development. It powers large-scale microservices and standalone applications. Most SpringBoot applications have embedded web servers and follow a distributed architecture consisting of three main types of application components: Backend: API services Backend: Event... Continue Reading →
Memory leak due to improper exception handling
In this post let's discuss an interesting memory problem we confronted in the production environment and how we went about solving it. This application would take traffic for a few hours after that it would become unresponsive. It wasn't clear what was causing the unresponsiveness in the application. Video: To see the visual walk-through of... Continue Reading →
Montreal 2022 – 16 ARTIFACTS TO CAPTURE WHEN THERE IS A PRODUCTION PROBLEM
ConFoo Montreal is a multi-technology conference for developers. Our Architect Ram Lakshmanan has been invited there to present on the topic "16 artifacts to capture when there is a production problem", which has secured 5th place among 155 sessions. Production problems are tricky to troubleshoot if proper diagnostic information isn’t captured. In this session, 16... Continue Reading →
JAX Online 2020 – WHY & HOW TO WRITE MEMORY EFFICIENT CODE?
JAX - Online Edition 2020 is the conference for JAVA, architecture and software innovations. This conference had 4 major workshops and nearly 20 sessions presented by many speakers from all over the world! All were performed live, carried out with the video platform and designed interactively for the developers. Our Architect Ram Lakshmanan's Why and... Continue Reading →
