free command shows Java process size much smaller than the initial heap size

Solution Verified - Updated -

Issue

  • Tomcat is starting with the initial and max heap set to 6144m; however, free output shows memory usage far below the initial heap size:
$ ps -ef | grep -i java
tomcat85      7      1 73 17:52 pts/0    00:00:51 /etc/alternatives/jre/bin/java -Xms6144m -Xmx6144m org.apache.catalina.startup.Bootstrap start

# free -m 
              total        used        free      shared  buff/cache   available
Mem:          15866         775       13180          11        1910       14757
Swap:          4515           0        4515

Environment

  • Red Hat Enterprise Application Platform
    • 7.x
  • Red hat OpenShift Container Platform (OCP)
    • 4.x
  • Red Hat build of OpenJDK 8, 11, 17, 21

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content