Home » Archives for Ram Lakshmanan

Author Archives: Ram Lakshmanan

Avatar photo
Ram Lakshmanan developed world's finest DevOps tools: GCeasy.io, fastThread.io, HeapHero.io. Every single day, millions & millions of people in North America—bank, travel, and commerce—use the applications that Ram Lakshmanan has architected. Ram is an acclaimed speaker in major conferences on scalability, availability, and performance topics. Recently, he has founded a startup, which specializes in troubleshooting performance problems.

Simulating & troubleshooting StackOverflowError in Scala

In this series of simulating and troubleshooting performance problems in Scala, let’s discuss how to simulate StackOverflowError. StackOverflowError is a runtime error, which is thrown, when a thread’s stack size exceeds its allocated memory limit.  Sample Program Here is a sample Scala program, which generates the StackOverflowError: package com.yc class StackOverflowApp { } object StackOverflowApp { def main(args: Array[String]): Unit ...

Read More »

Simulating & troubleshooting BLOCKED threads in Kotlin

In this series of simulating and troubleshooting performance problems in Kotlin, let’s discuss how to make threads go into BLOCKED state. A thread will enter into a BLOCKED state when it couldn’t acquire a lock on an object because another thread already holds the lock on the same object and doesn’t release it. Kotlin blocked thread Program Here is a ...

Read More »

Simulating & troubleshooting CPU spike in Kotlin

In this series of simulating and troubleshooting performance problems in Kotlin articles, let’s discuss how to simulate CPU consumption to spike up to 100% on a host (or container). CPU consumption will spike up whenever a thread goes on an infinite loop. Kotlin CPU Spike Program Here is a sample kotlin program, which generates the cpu spike. package com.buggyapp class ...

Read More »

Troubleshooting deadlock in an Apache opensource library

java-interview-questions-answers

Apache PDFBox is a popular open-source library that facilitates java applications to work with PDF documents. Recently we encountered a Deadlock that surfaced in this library. In this post we have shared how we troubleshooted and identified the root cause of the problem. What is Deadlock? First let’s try to understand what ‘Deadlock’ means. Several technical definitions aren’t clear. ‘Deadlock’ ...

Read More »

Chaos Engineering – Metaspace OutOfMemoryError

JVM memory has following regions:  a. Young Generation b. Old Generation c. Metaspace d. Others region When you encounter ‘java.lang.OutOfMemoryError: Metaspace’ it indicates that the Metaspace region in the JVM memory is getting saturated. Metaspace is the region where metadata details that are required to execute your application are stored. In nutshell they contain Class definitions and method definitions of ...

Read More »

Inspect the contents of the Java Metaspace region

JVM Memory has following regions: a. Young Generation b. Old Generation c. Metaspace d. Others region To see what objects are stored in what region, you may refer to this video clip. Sometimes your application might run into ‘java.lang.OutOfMemoryError: Metaspace’ as discussed in this post. In such circumstances you might want to see what are the Contents loaded in the ...

Read More »

Java String intern(): Performance impact

java.lang.String#intern() is an interesting function in Java. When used at the right place, it has potential to reduce overall memory consumption of your application by eliminating duplicate strings in your application. To learn how intern() function works, you may refer to this blog. In this post let’s discuss the performance impact of using java.lang.String#intern() function in your application. intern() function ...

Read More »

In which region intern strings are stored?

intern() is an interesting function in java.lang.String object. intern() function eliminates duplicate string objects from the application and has potential to reduce overall memory consumption of your application. To understand how string intern() function works you may refer to this interesting blog. Intern strings are stored in a string pool in the JVM memory. JVM Memory has following regions: a. ...

Read More »

Garbage Collection CPU Statistics

When a Garbage Collection event runs, it spends a predominant amount of its time in the Java application layer. It also spends a certain portion of its time in the Operating System/Kernel layer.  ‘User’ Time: Amount of time Garbage Collector spends in the Java application layer is reported as ‘User’ time in the GCeasy report. Here are the reasons for ...

Read More »