Your system is running Java right now

Here is one that surprises people who think of IBM i as purely an RPG and DB2 world: your system is very likely running Java right now, and you can watch it in detail. The HTTP server, IBM i Access services, and a great deal of modern vendor software all run in JVMs on your box, and when one of them misbehaves, the symptoms, high CPU, growing memory, mysterious slowdowns, can be baffling if you do not know to look at the Java layer.

IBM i gives you a window straight into every running JVM:

SELECT JOB_NAME, AUTHORIZATION_NAME,
       TOTAL_GC_TIME, GC_CYCLE_NUMBER,
       CURRENT_HEAP_SIZE, IN_USE_HEAP_SIZE,
       MAXIMUM_HEAP_SIZE
  FROM QSYS2.JVM_INFO
 ORDER BY IN_USE_HEAP_SIZE DESC;

That shows every active JVM on the system, who owns it, how much heap it is using against its maximum, and how hard garbage collection is working.

The columns tell a story once you know how to read them. IN_USE_HEAP_SIZE creeping steadily toward MAXIMUM_HEAP_SIZE is a classic sign of a JVM under memory pressure, and possibly a memory leak in the application. A TOTAL_GC_TIME and GC_CYCLE_NUMBER climbing fast means the JVM is spending real effort collecting garbage instead of doing work, which shows up to your users as sluggishness that no amount of staring at Db2 will explain.

This matters because Java problems on IBM i are often mislabeled. Someone reports a slow application; everyone looks at the database, disk, memory, and CPU utilization. The real culprit is a JVM quietly thrashing on garbage collection or bumping its heap ceiling. This one query puts that entire layer in view, and it will make you look like a wizard the day a Java-based application starts acting up.

Even if you think of yourself as a pure IBM i admin, this is worth knowing. Java runs whether you watch it or not. Better to watch it. #IBMI

Originally posted on LinkedIn. Join the conversation there.

Get new posts by email

Practical IBM i tips on SQL services, security and backup, sent when I publish. No spam, unsubscribe anytime.

Leave a Reply