how to overcome the java jstat tool inability to connect to a process

it’s an ownership issue. even fails as root. must connect as the same user who is running the java process, as follows:

first of all, be sure to run + jps + as root:

        $ jps
        23563 Jps
        $ sudo jps
        23584 Jps
        23182 -- process information unavailable

then, get the user who is running the process (note the 2nd column below):

        $ ps axopid,user,comm | grep 23182
        23182   fooman java

run + jstat + as that user:

        $ sudo -u fooman jstat -gcutil -t -h55 23182 1000