Search

GC easy – Universal Java GC Log Analyser

Tag

heap dump

LARGE OR SMALL MEMORY SIZE FOR MY APP?

The decision to use few large memory instances versus many small memory instances lacks a definitive answer, as evidenced by two successful technology companies adopting opposite strategies. Both approaches can work if backed by a competent team. However, large memory configurations are typically more expensive and can complicate performance troubleshooting.

OUTOFMEMORYERROR RELATED JVM ARGUMENTS

This article discusses useful JVM arguments for handling OutOfMemoryError, which assist in memory troubleshooting. It covers -XX:+HeapDumpOnOutOfMemoryError for capturing heap dumps, -XX:OnOutOfMemoryError for executing scripts, -XX:+CrashOnOutOfMemoryError and -XX:+ExitOnOutOfMemoryError for abrupt application exits, highlighting the importance of graceful handling in both cases.

AUTOMATING – OUTOFMEMORYERROR TROUBLESHOOTING

The article outlines a three-step automated approach to troubleshoot OutOfMemoryError in applications. First, it suggests capturing heap dumps using specific JVM arguments to gather memory data. Next, it recommends restarting the application via a custom script to prevent instability. Lastly, it discusses analyzing heap dumps with tools or an API for effective diagnosis.

SHALLOW HEAP, RETAINED HEAP

Eclipse MAT (Memory Analyzer Tool) is utilized for analyzing heap dumps to address memory issues, distinguishing between Shallow Heap and Retained Heap sizes. Shallow Heap refers to an object's size, whereas Retained Heap indicates memory freed if the object is garbage collected. Examples illustrate these concepts using an object model, revealing how references affect retained heap calculations.

HOW MUCH MEMORY IS MY APPLICATION WASTING?

In early 1970s 1 MB was costing 1 million $. Now 1 mb is costing fraction of that cost. There is no comparison. This is one of the reasons why engineers and enterprises don’t worry about memory any more.

JHAT – HEAP DUMP ANALYSIS

In this article, we will see how to analyze a heap dump in detail using ‘jhat’ tool. It’s easier to explain Heap analysis process with an example Memory leak program.

 How to Capture a Java Heap Dump? (JMAP & OOM Error)

Heap dump is a snapshot of the Java memory. It contains information about the Java objects and classes in the heap at the moment the snapshot is triggered. It’s vital artifact to diagnose any Java memory related problems.

Up ↑