Buggy App – Simulate performance problems

Buggy App is a simple java application that simulates different performance problems like Memory Leak, OutOfMemoryError, CPU spike, thread leak, StackOverflowError, deadlock, unresponsiveness, …

Using this application, you can simulate various performance problems in your environment. Here are a few use cases where Buggy App can be used: 

a. You can configure and launch Buggy App to consume high memory on the same server where your application is running. You can study under this circumstance whether your application’s SLA (Service Level Agreement) is impacted.

b. You can configure and launch Buggy App in a docker container to consume high CPU and see whether other containers on the same host are impacted or not.

c. If you are building performance tools or monitoring tools, you can simulate various performance degradations using Buggy App and see whether your tools address those performance probelms. (Infact we developed this BuggyApp to validate our root cause analysis tool yCrash behaviour.)

How to run BuggyApp from Command line?

1. Make sure Java 8 or above version is installed on your machine

2. Download buggyapp-latest.zip file

3. Unzip buggyapp-latest.zip to a folder say ‘/opt/buggyapp’. In this folder you will find buggyApp.jar file.

4. To simulate CPU spike, invoke buggyapp.jar with following arguments:

java -jar buggyApp.jar PROBLEM_CPU

Below are the arguments that you can pass to BuggyApp to simulate different types of performance problems.

1. OutOfMemoryError: Java heap space

 To generate ‘java.lang.OutOfMemoryError: Java heap space’ launch Buggy App with following arguments:

java -Xmx512m -jar buggyApp.jar PROBLEM_OOM

2. Memory Leak

 If you would like to simulate a memory leak without experiencing OutOfMemoryError, then launch Buggy App with the following arguments:

 java -jar buggyApp.jar PROBLEM_MEMORY

 When you launch the Buggy App with these arguments, 80% – 90% of the allocated memory will be consumed. But it will not result in OutOfMemoryError.

3. CPU spike

 If you would like the CPU consumption to go up to 80 – 90% then launch the Buggy App with following arguments:

 java -jar buggyApp.jar PROBLEM_CPU

4. Thread Leak

 If you would like the application to keep slowly spawning new threads, then launch the Buggy App with the following arguments:

java -jar buggyApp.jar PROBLEM_THREADLEAK

When you launch the Buggy App with these arguments eventually  ‘java.lang.OutOfMemoryError: Unable to create new native thread’ will be generated.

5. Deadlock

 If you would like the application to experience Deadlock, then launch the Buggy App with the following arguments:

 java -jar buggyApp.jar PROBLEM_DEADLOCK

6. Stackoverflow Error

 If you would like the application to experience ‘java.lang.StackOverflowError’, then launch the Buggy App with the following arguments:

 java -jar buggyApp.jar PROBLEM_STACKOVERFLOW

7. Blocked Threads

 If you would like to put multiple threads in BLOCKED state, then launch the Buggy App with the following arguments:

 java -jar buggyApp.jar PROBLEM_BLOCKED

8. Heavy I/O

 If you would like to simulate heavy I/O activity, then launch the Buggy App with the following arguments:

 java -jar buggyApp.jar PROBLEM_IO

When you launch buggyApp with this argument, application will create 5 unique files by name: fileIO-1.txt, fileIO-2.txt, fileIO-3.txt, fileIO-4.txt, fileIO-5.txt. Then 20 lines of contents will be written in to this file and read back again and again infinietly. It will cause heavy I/O activity on the host.

Leave a Reply

Powered by WordPress.com.

Up ↑

%d bloggers like this: