At the same time, in JBoss management console, I could see under 'Pool Usage' tab, 'Active Count' and 'Max Used' - Is this
the correct representation of pool usage?
Yes, Max Used is the peak number of connections used concurrent.
AFAIR you need to enable the jca pool connection logging to see whether connections are handed out or returned to pool, not sure whether it shows the current usage.
But you can invoke CLI to show the pool usage periodical.
For memory usage I would use the GC logfile, enable it by set the options to standalone.conf (i.e. -verbose:gc) you need to check the parameters for your JVM
I managed to write gc details into a log file. I added that in the services.bat. Can you please let me know, how I could get that 'Max Used' / 'Active Count' and 'activeSessions' values into a file? Do I have to write a standalone script or Java program to do that? Or Is it possible to include it in the services.bat, just like gc log? If you could provide some samples that will be useful. Thanks.
you can use the bin/jboss-cli.sh script and call it from a shell script or cron job periodically.
The command is
bin/jboss-cli.sh -c "/subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-runtime="true", recursive=true)"
also you are able to read a specific attribute using ":read-attribute(name=ActiveCount)"
You can redirect this to a file like each Unix command