Arun
Arun

Reputation: 3700

Java Heap dump and Thread dump in PCF

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

Upvotes: 4

Views: 7467

Answers (2)

Tim Gerlach
Tim Gerlach

Reputation: 3390

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.

Upvotes: 2

Tim
Tim

Reputation: 2707

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

Upvotes: 3

Related Questions