Javatpoint Logo
Javatpoint Logo

IntelliJ IDEA Profiler

Profiler gives an accurate information about our application performance. It measures the performance of CPU, Memory and Heap usage by our application. It also provides us the detailed information about application thread. VisualVM tool is used to measure the Java application profiling.

What is VisualVM?

It is a visual tool which has been bundled with the JDK along with Java 6 or greater version. It is good for beginners and gives detailed information about our application performance.

Configuration

In Windows

  1. Download VisualVM. To download Click here.
  2. Extract the Downloaded Zip file.
  3. In the extracted file go to etc/visualvm.conf file. Check the following line visualvm_jdkhome=""
  4. If Jdk is installed then it should look like this visualvm_jdkhome="C:\Program Files\Java\jdk-8.0.1"

In Linux

To install VisualVM, type the following in the terminal:

  1. $ sudo apt-get install default-jdk.
  2. $ sudo apt install visualvm.
  3. To open VisualVM type $ visualvm.

Monitoring Application

  1. Open visualvm.
  2. Select Application in the left pane.
  3. Choose the Monitor tab.

We can see here about the usage of CPU, Heap, Classes and Threads. We can also see specific usage by hovering the mouse over any graph.


IntelliJ IDEA Profiler

Threads Measure

Every Java application have multiple Threads. We can see the detailed information about threads in VisualVM tool. Select Thread tab, it will show various statistics about our application threads such as number of Live threads and Daemon threads . We can see it in the following figure in which Running, Sleeping, Wait, Park, Monitor thread shown us.


IntelliJ IDEA Profiler

Sampling Application

VisualVM gives us the information of CPU, Memory Sampling and Memory Leak. To do sampling, select application and choose Sampler tab. Sampler Tab have three Sub-Tab-: CPU Tab, Memory Tab, and Stop Tap.

CPU Sampling

To do the CPU sampling, click on CPU button. The following screenshot will appear.


IntelliJ IDEA Profiler

Memory Sampling

To do the Memory Sampling, click on Memory button. The following screenshot will appear.


IntelliJ IDEA Profiler

Memory Leaks

Memory leak is a situation where some objects are not used in the application anymore and garbage collector fails to recognize them as unused. During the running of program, it fills up the heap area with an object which are not used in the program. When the memory space is full because of the unnecessary object storage then we can understand it the indication of the memory leak.






Please Share

facebook twitter google plus pinterest

B.Tech / MCA


Learn Latest Tutorials