I was struggling to understand a problem with shared classes in Java and I found the options being used by my program were not as I expected.
I thought it would be a very simple task to display at start up options used. It may be, but I could not find how to do it. If anyone knows the simple answer please tell me.
I found one way – take a dump! This seems a little extreme, but it was all I could find. With Liberty you can take a javacore dump (F IZUSVR1,JAVACORE) and display it, or you can take a dump at start up.
In the jvm.options I specified
This gave me in //STDERR
JVMDUMP039I Processing dump event “vmstart”, detail “” at 2021/05/20 13:19:06 – please wait.
JVMDUMP032I JVM requested Java dump using ‘/S0W1/var/…/javacore.20210520.131906.65569.0001.txt’
JVMDUMP010I Java dump written to /S0W1/var…/javacore.20210520.131906.65569.0001.txt
JVMDUMP013I Processed dump event “vmstart”, detail “”.
In this file was list of all the options passed to the JVM
the storage limits
1CIUSERLIMITS User Limits (in bytes except for NOFILE and NPROC) NULL ------------------------------------------------------------------------ NULL type soft limit hard limit 2CIUSERLIMIT RLIMIT_AS 1831837696 unlimited 2CIUSERLIMIT RLIMIT_CORE 4194304 4194304 2CIUSERLIMIT RLIMIT_CPU unlimited unlimited 2CIUSERLIMIT RLIMIT_DATA unlimited unlimited 2CIUSERLIMIT RLIMIT_FSIZE unlimited unlimited 2CIUSERLIMIT RLIMIT_NOFILE 10000 10000 2CIUSERLIMIT RLIMIT_STACK unlimited unlimited 2CIUSERLIMIT RLIMIT_MEMLIMIT 4294967296 4294967296
and environment variables used.
1CIENVVARS Environment Variables
All interesting stuff including the -X.. parameters. I could see that the parameters I had specified were not being picked up because they were specified higher up! Another face palm moment.
There was a lot more interesting stuff in the file, but this was not relevant to my little problems.
Once z/OSMF was active I took a dump using the f izusvr1,javacore command and looked at the information on the shared classes cache
1SCLTEXTCMST Cache Memory Status 1SCLTEXTCNTD Cache Name Cache path 2SCLTEXTCMDT sharedcc_IZUSVR /tmp/javasharedresources/..._IZUSVR_G37 2SCLTEXTCPF Cache is 85% full 2SCLTEXTCSZ Cache size = 104857040 2SCLTEXTSMB Softmx bytes = 104857040 2SCLTEXTFRB Free bytes = 14936416
This is where I found the shared cache was not what I was expecting! I originally spotted that the cache was too small – and made it bigger.
Remember to delete the javacore files.
I removed the -Xdump:java:events=vmstart statement, because I found it more convenient to use the f izusvr1,javacore command to take a dump when needed.