MySQL run command via command line

To run mysql commands via linux command line. Append -e and the command that you need to run.

mysql -u root -p -e 'SHOW PROCESSLIST\G;' | grep row | tail -1


Investigate Memory Leaks

To get a java dump out run the below command

jmap -dump:file=/tmp/dump.out javapid

Then run jmap to display the contents

jhat -port 7000 -J-mx16g /tmp/dump.out

Then when its running browse to your server hostname with port 7000 attached.