Is there a way to collect the thread-dump and heap-dump in PCF for Java Apps.
I know that we can ssh in to apps and run any linux commands. But the ssh is disabled by the operations team. So i wanted to understand if there are any other supported ways in PCF
Pivotal Apps Manager supports interactions with Spring Boot Actuator Endpoints (like thread dump and heap dump) quite nicely https://docs.pivotal.io/pivotalcf/2-4/console/using-actuators.html
In addition to the Spring Boot Actuator endpoint mentioned by Tim, when ssh privleges are not an issue, there's also the cf java cli plugin which creates and downloads heap dumps and thread dumps as simple as
cf java heap-dump APP_NAME > heapdump.hprof
On top of that there's the Java Memory Assistant, which is well integrated into the Java Buildpack.
Note that the creation of heap dumps is always restricted to the available disk size to your container. Depending on the size of your heap after a garbage collection (which is triggered automatically when creating a heap dump) it might be necessary to increase disk size of your container via cf scale APP_NAME -k 2G.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With