JDK Mission Control (JMC) shows 99.6% memory used by Java application

183 views Asked by At

As the title explains, when I open the JFR profiling file in JMC GUI, it shows a severe memory usage by the SpringBoot application I've been running. It's a rather simple application with a few controllers, Spring Security and a MongoDB connection. However, when I keep monitoring my application with MacOS Activity Monitor and top CLI tool, it shows a different statistic. Can anyone explain what's going on here?

I'm super new to Java profiling and to JFR/JMC so any answer is highly appreciated.

JMC result: JMC output shows 99.6% memory is used by Java application

Activity Monitor Max memory usage is by IntelliJ as per Activity Monitor

top -o MEM top tools shows similar to Activity Monitor

Edit 1: (Application details) The application is a regular SpringBoot application with few RestControllers for auth (registration, login), user details retrieval and few other CRUD-related controllers, and correspoding Service components for those models. I'm using SpringBoot Mongo Starter package and Spring Security Starter for data persistence operations and for security. Other than that there's a DB Seeder configuration that loads a json file at startup (250 entries with each entry having only 2 fields) and persist in DB.

For the record, this memory profile is recorded when I startup the application, and made few REST API calls to test basic functionalities. I can guarantee there are no memory intensive operations within the application.

What I want to know is "why the difference between JMC and other monitoring tools?". Hope my question is clear.

1

There are 1 answers

0
Hirt On

JFR will not only report the JVM process memory usage, or the heap usage of the JVM (it does that too), but it will also report on the total physical memory available on the machine (and usage). It seems you have access to 8GB of physical memory, and you are currently using 7.97 GB (i.e. almost all) of the physical memory available (for everything running on your machine, including your Java Virtual Machine with your application). If you have suggestions on how to improve the text, please let me know! :)

The memory page can be helpful when looking at how much memory is utilized, for example for the heap. If you hover over the legends in the graph, you will get a description of what you are looking at.

Image of the JMC Memory Page