Search code examples
javaprofilingopenshiftjprofiler

Is there way to connect profiler OSE JAVA app pods?


  • There is memory leak in my spring boot application It was able to take 70 concurrent request at ramup of 5seconds and it works smooth on my local machine

When I did deploy the same application on OSE it created out of memory issue

I was trying to connect java profiling tools to remote OPENSHIFT java pods?

Is there any procedure to collect the heap dump or connect profile tool(jvisualvm) to ose pod?


Solution

  • There are manual ways of collecting the ThreadDump & HeapDump in out of memory situations

    1. oc get pods - > List Pods
    2. oc rsh pod -> Remote shell to pod
    3. "jmap -dump:format=b,file=heap_dump1.hprof 1" -> Running the JMAP command to collect the heap dump
    4. "jcmd 1 Thread.print > threaddump.txt" -> Running jcmd to collect the thread dump
    5. oc volume dc/yourApp --add --claim-size 512M --mount-path --name downloads -> Creating the persistent volumes

    After connecting the pods manually, explicitly execute the commands on the ose terminal 3 & 4 Till the application reaches the OOM & because of dump on the persistent volume logs will not be cleared

    1. Copy the heapDump files & threadDump files from OSE pod to Local fileSystem after zipping them by "tar"

    oc rsync