The Performance Impact of java.lang.System.getProperty()

‘java.lang.System.getProperty()’ is a common API used by Java developers to read the System properties that are configured during application startup time. i.e. when you pass “-DappName=buggyApp” as your application’s startup JVM argument, the value of the ‘appName’ system property can be read by invoking the ‘java.lang.System.getProperty()’. Example:

Java
 
public static String getAppName() {    
  
    String app = System.getProperty("appName");   
    return app;
}


Is Today’s Microservice More Bloated than Yesterday’s Monolith?

I am slightly hesitant to write this post, as it might attract some criticism. Nevertheless, I told myself there is nothing wrong with sharing my point of view (even though it might not be well accepted). I would like to share my personal experience regarding yesterday’s Monolithic and today’s Microservice architecture in this post.

Yesterday’s Monolithic Application

20 years back, I was starting my career. At that point, I was working for a large financial corporation in N. America. This financial institution’s middleware platform was running in CORBA, C++ platform. Since CORBA was getting extinct around that time, the technology vendor decided not to support CORBA anymore. It was a huge risk for the enterprise to run its mission-critical middleware platform on unsupported technology. Thus, management decided to port their middleware application to platform-independent technology stack: "SOAP" and "Java," which was considered as the cool kid of the time. 

Overhead Added by Collecting Thread Dumps

A thread dump is a snapshot of all the threads running in a Java process. It’s a vital artifact to troubleshoot various production problems such as CPU spikes, unresponsiveness in the application, poor response time, hung threads, high memory consumption. Thus to facilitate troubleshooting, we have seen enterprises capture thread dumps on a periodic basis (every 5 minutes or 2 minutes). So we were curious to learn the overhead of capturing thread dump on a periodic basis. Thus we set out to conduct the below case study.

Environment

For our study, we chose to use the open-source Spring Boot Pet Clinic application. Pet Clinic is a poster child application that was developed to demonstrate the Spring Boot framework features. 

Chaos Engineering: Blocked Threads

In the series of chaos engineering articles, we have been learning to simulate various performance problems. In this post, let’s discuss how to make threads go into a BLOCKED state.

Sample Program

Here is a sample program from the open-source BuggyApp application, which would make threads go into a 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. Review the program carefully.

Chaos Engineering – Stackoverflow Error

In our series of chaos engineering articles, we have been learning to simulate various performance problems. In this post, let’s discuss how to simulate a StackOverflow error. A StackOverflow error is a runtime error. In this post, we'll simulate a StackOverflowError, diagnose it, and solve the problem.

Sample Program

Here is a sample program from the open source BuggyApp application, which would generate java.lang.StackOverflowError.

Chaos Engineering: Thread Leak

In the series of chaos engineering articles, we have been learning to simulate various performance problems. In this post, let’s discuss how to simulate thread leaks. ‘java.lang.OutOfMemoryError: unable to create new native thread’ will be thrown when more threads are created than the memory capacity of the device. When this error is thrown, it will disrupt the application’s availability.

Sample Program

Here is a sample program from the open source BuggyApp application, which keeps creating an infinite number of threads.

Chaos Engineering: Deadlock

In this series of chaos engineering articles, we have been learning to simulate various performance problems. In this post, let’s discuss how to simulate deadlock.

What Is a Deadlock?

Deadlocks tend to happen in multi-threaded applications. The technical definition of a ‘deadlock’ is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. Here is a practical example that may help you understand deadlocks. 

What Are Garbage Collection Logs, Thread Dumps, and Heap Dumps?

Java Virtual Machine (JVM) generates 3 critical artifacts that are useful for optimizing the performance and troubleshooting production problems. Those artifacts are:

  1. Garbage collection (GC) log
  2. Thread Dump
  3. Heap Dump

In this article, let's try to understand these 3 critical artifacts, where to use them, how do they look, how to capture them, how to analyze them, and their differences.

Log4j Bug — Slows Down Your Application

Learn how to troubleshoot your application.

Recently we were troubleshooting a popular SaaS application. This application was slowing down intermittently. To recover from the problem, the application had to be restarted. This application was slowing down sometimes during high traffic volume periods; sometimes during low traffic periods as well. There was no cohesive pattern.

You may also like: How Slow App Performance Can Impact Your Bottom Line