Jps / jstack not listing oh process

  • Platform information:
    • Hardware: Intel I7 13.
    • OS: official Docker Image
    • Java Runtime Environment: official Docker Image
    • openHAB version: 4.0M2

I am having an memory issue (java heap space) and want to debug where it is, but jps does not list the java process just itself.
As well using ps and use the process id with jstack gives me an error that there is no jvm.
I tried with 4.0M2 (inside docker) with the latest 3.X (inside and outside of docker) and with zulu jdk none of them worked.
I found some threads here where people used or should used jps and jstack but i am asking myself why does it not work for me?

Can somebody please help.

I can’t help you here, but I use VisualVM and that works fine.

If you have an issue with out of memory error enable diagnostic options (HeapDumpOnMemoryError AFAIK), plus adjust systemd termination delays to let dump complete. Once you have it you can browse contents of memory and look for suspicious elements.

If you can reproduce issue anywhere they try running Yourkit or other professional tool in trial. I find Yourkit quite good in tracking allocations/generations over time and helping with issues of such kind. Trial is free for couple of days, and should be sufficient for a start.

The problem is that the process does not crash. It’s still running but nothing’s working anymore.
I found the current issue but having an option to make a dump while running would be still fine.

can somebody please check if jps prints the openhab process id?

ok got something, jps isn’t working but getting the process with ps and executing the jmap command with the correct user it’s working