"use strict";(self.webpackChunkdocs_website=self.webpackChunkdocs_website||[]).push([[80136],{15680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>h});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var s=n.createContext({}),c=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return n.createElement(s.Provider,{value:t},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(a),d=r,h=u["".concat(s,".").concat(d)]||u[d]||m[d]||i;return a?n.createElement(h,o(o({ref:t},p),{},{components:a})):n.createElement(h,o({ref:t},p))}));function h(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:r,o[1]=l;for(var c=2;c{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>h,frontMatter:()=>l,metadata:()=>c,toc:()=>u});a(96540);var n=a(15680);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})),e}function o(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},i=Object.keys(e);for(n=0;n=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}const l={title:"Debugging by Jattach",hide_title:!0,sidebar_label:"Debugging by Jattach",slug:"/how/jattach-guide",custom_edit_url:"https://github.com/datahub-project/datahub/blob/master/docs/how/jattach-guide.md"},s=void 0,c={unversionedId:"docs/how/jattach-guide",id:"docs/how/jattach-guide",title:"Debugging by Jattach",description:"We have installed jattach in Docker image of datahub-gms, datahub-mae-consumer, datahub-mce-consumer",source:"@site/genDocs/docs/how/jattach-guide.md",sourceDirName:"docs/how",slug:"/how/jattach-guide",permalink:"/docs/how/jattach-guide",draft:!1,editUrl:"https://github.com/datahub-project/datahub/blob/master/docs/how/jattach-guide.md",tags:[],version:"current",frontMatter:{title:"Debugging by Jattach",hide_title:!0,sidebar_label:"Debugging by Jattach",slug:"/how/jattach-guide",custom_edit_url:"https://github.com/datahub-project/datahub/blob/master/docs/how/jattach-guide.md"},sidebar:"overviewSidebar",previous:{title:"Configuring Kafka",permalink:"/docs/how/kafka-config"},next:{title:"Deployment Guides",permalink:"/docs/category/deployment-guides"}},p={},u=[{value:"Example 1: Dump heap",id:"example-1-dump-heap",level:2},{value:"Example 2: Dump thread",id:"example-2-dump-thread",level:2}],m={toc:u},d="wrapper";function h(e){var{components:t}=e,a=o(e,["components"]);return(0,n.yg)(d,i(function(e){for(var t=1;t dumpheap /tmp/heap.bin\n")),(0,n.yg)("h2",{id:"example-2-dump-thread"},"Example 2: Dump thread"),(0,n.yg)("p",null,"The jattach threaddump command is typically used in the following scenarios:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},"Deadlock analysis: When an application experiences deadlocks or thread contention issues, the jattach threaddump\ncommand is used to generate a thread dump file. It provides the current thread's stack trace information, helping to\nidentify the code paths and lock contention causing the deadlock.")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},"Thread troubleshooting: When threads in an application encounter exceptions, long blocking times, excessive CPU usage,\nor other issues, generating a thread dump file provides detailed information about each thread's state, stack trace, and\nresource usage. This helps with troubleshooting and analysis.")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},"Performance analysis: By generating a thread dump file, it becomes possible to understand the thread activity, call\npaths, and resource contention within the application. This aids in identifying potential performance bottlenecks and\nconcurrency issues.")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},"Monitoring and diagnostics: Regularly generating thread dump files can be used to monitor the health of an application\nand provide historical data for subsequent diagnostics. This helps gain a better understanding of the application's\nbehavior and performance."))),(0,n.yg)("p",null,"It's important to note that generating a thread dump file may impact the performance of the application. Therefore,\ncaution should be exercised when using it in a production environment, ensuring sufficient resources and permissions\nare available for the operation."),(0,n.yg)("p",null,"The command is as follows:"),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-bash"},"jattach threaddump -l > /tmp/jstack.out\n")))}h.isMDXComponent=!0}}]);