Continuous WebLogic Thread Dump Tutorial

2015/07/03


Question:
One of WebLogic Comminity person posted this question on Stackoverflow portal. But unfortunately editors deleted the content. Anyway, which was about getting stack dump or thread dump from WebLogic server.

Our clients have been addressed WLSDM for the solution. Absolutely, WLSDM is the right place to achive this.

Now, we're going to explain how it's easy to do this by using WLSDM which is aimed to monitor WebLogic domains naturally :)

Introduction:
Normally, it's easy to do by shell and WLST scripting; but getting thread dump continuously can be challenge and risky. It can create an overhead on your WebLogic domain.

weblogic-wlsdm-portlet.png

Solution:
Let's say you're familiar with WLSDM. It's really easy to install WLSDM and use it. If you're not introduced with WLSDM for WebLogic just follow this blog post on WLSDM community portal. WLSDM Intorduction

Step-1: Go to "Configuration / System" Page and focus on "system.metric" tab. There are two important properties on WLSDM configuartion/system page. Metric harvest frequency and number of alarm count till alarm situation is valid. Screenshot is below and values are default.

1_wlsdm_weblogic_harvest_frequency_weblogic_alarm.png

The harvest frequency and number of alarm count can be changed. For the continues thread dump, just set it more than 1. Let's set the value to 10. Which means 10 alarms would be generated if the situation is still valid.

Step-2: Go to "System / Metrics" page. For instance, find ActiveExecuteThread MBean record, then click on "Edit" button. There is Actions button for each servers on WebLogic domain (Screenshot Number-1). Click on actions button and select "Thread Dump" action (Screenshot Number-2) and save. Check below screenshot:

2_wlsdm_actions_weblogic_jfr_diagnostic_image_heap_thread_dump.png

Step-3: The alarm must be enable by setting a threshold value which is less than current ActiveExecuteThread MBean value in ThreadPoolRuntime.

After all, WLSDM would start notifying you via email by attaching "WebLogic Server Thread Dump" or "Dump Stack" files continuously. Check below screen shot.

  • WLSDM created ALERT notifications every 30 seconds by attaching thread dump files. See pointer.
    3_wlsdm_alert_notification_thread_stack_dump_mail_attachment.png

  • Thread dump files attached to emails.
    4_wlsdm_weblogic_server_continous_thread_dump.png

  • Also the thread dumps are listed on "Profiling Dumps" page on WLSDM console.
    5_wlsdm_weblogic_profiling_dump_pages.png

  • See details of thread dump on WLSDM console.
    6_wlsdm_view_weblogic_server_thread_dump_on_wlsdm_console.png

  • It's possible to analyze thread dumps by using WLSDM's thread dump viewer and analyzer module.

  • Besides thread dump action, there are even more actions available on WLSDM. These are:

    • Java Flight Recorder (JFR)
    • Heap Dump (.HPROF)
    • WebLogic Diagnostic Framework (WLDF) Image (.ZIP)

If you want to learn much about WLSDM actions, there is a good tutorial on Youtube. Here is link: https://www.youtube.com/watch?v=ec-MccMPCqY (WLSDM Actions)

Hope, you enjoy this detailed answer on WLSDM community portal.

WLSDM Support Team

Source Links:

1- http://stackoverflow.com/questions/30776122/retrieve-the-current-stack-information-from-a-weblogic-server

2- www.wlsdm.com/download

3- Other YouTube tutorials available.
https://www.youtube.com/channel/UC_xrMkl9iGYk3WslxO1G0dw/videos


WLSDM Community Support Team

Follow Us and Get Updates!