0

I am running my java web application using my IDE (IntelliJ) and doing a heavy bulk operation, which by now is running since around 5 hours or so. It includes a lot of database inserts, a lot of object creations, I guess it is also kind of CPU intense, and it is not at all heavy on the network.

A current look in my task manager (windows) gives me these numbers:

  • CPU: 35%
  • RAM: 49%
  • IO: 1%
  • Network: 0%
  • GPU: 5%

Usage by processes, is ...

... orderd by CPU-usage it is like this:

  1. "PostreSQL Server"
  2. "IntelliJ IDEA (9)"
  3. "Google Chrome (16)"

... ordered by memory consumption:

  1. "IntelliJ IDEA (9)"
  2. "Google Chrome(16)"
  3. "OpenJDK Platform binary"

My subjective feeling is definitely, that my computer is hard working, I hear the fan go non-stop and also when switching between windows I witness lag.

I wonder however, why my task manager is not showing that my computer is using one of the resources to its' full extent?

I guess it means, that my application is already using the maximum available memory (limited by the JVM heapsize)? I did not specify this explicitly, and running

java -XX:+PrintFlagsFinal -version | findstr HeapSize

yields these defaults for me:

uintx ErgoHeapSizeLimit                         = 0                                   {product}
    uintx HeapSizePerGCThread                       = 87241520                            {product}
    uintx InitialHeapSize                          := 268435456                           {product}
    uintx LargePageHeapSizeThreshold                = 134217728                           {product}
    uintx MaxHeapSize                              := 4271898624                          {product}
openjdk version "1.8.0_202"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.202-b08, mixed mode)

I have got 16 GB physical RAM on my machine, do you suggest I should set an explicit value for xms and xmx as described here? How can I increase the JVM memory?

SebastianRiemer
  • 1,495
  • 2
  • 20
  • 33

1 Answers1

0

By default, JVM uses 1/4 of available physical memory as MaxHeapSize. If you need more, then you can specify that via -Xmx. It really depends on your application and its needs.

Note that IDEA itself may consume a lot of memory since it's also Java application. If you're worried about performance you should profile your application first (start by something like VisualVM) and then tune as necessary.

Juraj Martinka
  • 3,991
  • 2
  • 23
  • 25