{"id":2610,"date":"2021-10-18T09:00:27","date_gmt":"2021-10-18T00:00:27","guid":{"rendered":"https:\/\/jennifersoft.com\/en\/uncategorized\/%ec%8a%a4%ed%83%9d%ed%8a%b8%eb%a0%88%ec%9d%b4%ec%8a%a4-%ec%83%98%ed%94%8c%eb%a7%81%ec%9d%84-%ec%9d%b4%ec%9a%a9%ed%95%9c-%ec%84%b1%eb%8a%a5-%eb%b6%84%ec%84%9d\/"},"modified":"2022-04-18T15:51:20","modified_gmt":"2022-04-18T06:51:20","slug":"2021-10-23","status":"publish","type":"post","link":"https:\/\/jennifersoft.com\/en\/blog\/tech\/2021-10-23\/","title":{"rendered":"Stacktrace Sampling Based Performance Analysis"},"content":{"rendered":"\n<figure class=\"wp-block-image big\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/Property-116-3.gif\" alt=\"\" class=\"wp-image-10203\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThe J company that\ndeveloper Y works for is using an old version of installation type of Jira\nsoftware\n\n\n\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Although the developer knows that it is installed somewhere in IDC and the equipment is very old, it is very difficult to either upgrade it or install it in a new location due to the license policy that requires allocation of license on a hardware basis.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br> Developer Y with anxiety about the response time that goes down very much sometimes (Why the hell is this slow!)<br> Developer Y tries to install an APM that the company is developing to do a method profiling, but that attempt fails miserably very soon.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cWhich\npackage should I configure?\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cLet\u2019s\nmonitor it first!\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using\nthe X-View chart, which is the key function of APM installed, developer Y can\ncheck the transaction located at the top of the Y axis (Oh, yes..).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-01-1-750x860.png\" alt=\"\" class=\"wp-image-10129\"\/><figcaption>Transaction marked at the top of Y axis in the X-View chart<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In\nhigh spirits, developer Y tries to drag the point that is about to penetrate\nthe ceiling of the chart.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-02-1-1024x110.png\" alt=\"\" class=\"wp-image-10127\"\/><figcaption>&nbsp;There is some Not Profiled area that lasts for more than 12 seconds<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cIt\ntakes more than 12 seconds to finish the transaction&#8230; What is the reason?\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The area of delay is not a traditional bottleneck such as an SQL or HTTP call, so developer Y feels a heavy heart. <br> Knowing that Jira is developed by the company called Atlassian, <br>so developer Y decides to configure the profile of the com.atlassian package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">so developer Y decides to configure the profile of the com.atlassian package.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-03-1-1024x312.png\" alt=\"\" class=\"wp-image-10135\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Urghh.. As soon as it is configured, the system CPU usage rate exceeds 52%.<br>After calming down the worrisome heart, developer Y drags the X-View chart.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Can\ndeveloper Y find out why it is happening?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-04-1024x566.png\" alt=\"\" class=\"wp-image-10137\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ah..\nAlthough numerous methods are profiled, unfortunately, most of methods take 0ms\nto 1ms. Looking at the X-View chart, the service response time slows down a\nlot.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-05.png\" alt=\"\" class=\"wp-image-10139\" width=\"373\" height=\"332\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The manager might blame developer Y. (Come on! Cheer up!)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In\nthis case, is it a bad attempt to do profiling?<br>\nIf a method of certain class within the configured package caused a delay, it\nwould have been possible to find out the cause.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However,\nin a modern application, very bad performance for a specific method developed\nby users does not impact the response time very much.<br>\nBecause in most environments, it is developed by using a well prepared\nframework.<br>\nBy profiling the com.atlassian package, it is not possible to check the\nsignificant profile information. <br>\nIn most cases, caches are prepared internally, and it is not very highly likely\nto cause a performance problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If\nthere is an SQL or HTTP call that takes long time, then you might want to tune\nthe target at the remote site, but if there is not, then it would be much more\ndifficult to resolve.<br>\nWhat if you configure all the packages corresponding to the loaded class(!!)\nMaybe we can find it.<br>\nBut, due to the amount of additional load and data applied to the application,\nwe will have to pay enormously high costs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Alright, then how\nshould we analyze the situation?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There\nare two ways of performance analysis &#8211; profiling and sampling.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Profiling<br><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">It\ninvolves collecting performance data from each method that runs and finding and\nimproving the methods that take a long time.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/profiling-1-1024x187.png\" alt=\"\" class=\"wp-image-10190\"\/><figcaption>Track the beginning and end of each method and measure the response time.<br> The slowest methods for Transaction1 and Transaction2 are Method2 and Method 4, respectively. <br><\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">2. Sampleing<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">It\ninvolves collecting performance data from each method that runs and finding and\nimproving the methods that take a long time.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/Stactrace-1024x567.png\" alt=\"\" class=\"wp-image-10184\"\/><figcaption>Periodically collect snapshots of methods running in each thread and measure the response time.<br> In the figure, we can tell that Method1 is the cause of delay. <br><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Profiling\nis a traditional method, so it has been used for a long time throughout\nhistory.<br>\nThus, lots of monitoring products basically provide profiling oriented\nfunctions.<br>\nIt sounds near perfect, but actually, it has some limitations as follows.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>A user must be aware of the target\n     method to monitor (Maybe developers would know).<\/li><li>If used for applications in the\n     operation environment with high traffic, the performance can be affected\n     (What if I configure the package with many classes, oops?).<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">However,\ntraffic leading to true performance improvement occurs in the operation\nenvironment only.<br>\nIf there is a way to monitor them in any kind of environment, then it would be\npossible to overcome the limitation of profiling? <br>\nOne of the methods is called <strong>sampling<\/strong>\nthat we discussed earlier.<br>\nThis method involves finding the location of bottleneck based on the frequency\nof appearance by periodically collecting stacktraces from each thread where the\nmethod call is generated, without directly tracking individual methods.<br>\n(When the stacktrace is collected 3 times for the time period of 100ms, if\nmethod a appears all 3 times, then we assume that method a is running for\n300ms.)<br>\nCompared to the profiling based method, it is less accurate, but it relatively\nless affects the performance while collecting data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What\nare the main causes of processing delays?<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Method that consumes lots of CPU\n     resources<\/li><li>Method that synchronously processes\n     the I\/O<\/li><li>Method that iterates big collection\n     objects<\/li><li>Method with unnecessary thread\n     synchronization<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Using the stacktrace based sampling method, it is possible to find the above mentioned methods without requiring special configurations. Because whether it consumes lots of CPU resources or processes lots of I\/O, the method that runs for a long time always repeatedly appears in the stacktrace. <br>Of course, sampling is also not a new method, there can be many existing useful tools available.<br>I like to use the VisualVM tool. It can periodically collect stacktraces from each thread and display the results of call frequency nicely, thus helping you in easily finding the location of bottleneck.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/Stack-trace06-1024x576.png\" alt=\"\" class=\"wp-image-10046\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Since it has relatively much less impacts on the performance, you can use it in an operation environment having high traffic without worries.&nbsp;<br>Actually, it came in handy many times when I tried to improve the performance of the APM collection server which I am responsible for.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After\nsome time has passed, It came across my mind.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>\u201cThis kind of tool is not available in client\u2019s company.. (There are lots of reasons such as security and so on.)<\/strong><\/em><strong><em><br> It would be nice if our product users can experience the effects of sampling based analysis methods.\u201d<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>\u201cHah..\nIt is really good, but I don\u2019t know how to explain it..\u201d<\/strong><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><strong>\u201cCome\non! Can we just provide the method in our products?!\u201d<\/strong><\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Checking individual stacktraces collected from transactions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"> JENNIFER is also not free from the limitation of profiling that we discussed earlier. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It can\neasily profile desired methods in real time, but users are required to know\nwhere they should look at. Of course, there are many ways to resolve this\nproblem. Mainly, after collecting the stacktrace information in real time, you\nwould look for the profiling target. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Identifying and selecting the\n     profiling target from stacktrace of specific port by using the socket\n     monitoring function<\/li><li>Identifying and selecting the\n     profiling target from stacktrace of specific thread by using the thread\n     monitoring function<\/li><li>Identifying and selecting the\n     profiling target after collecting stacktrace up to the point where a\n     specific class or method is called, by using the dynamic stacktrace\n     function<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If\nthere is a call area not found using the above method, the detailed X-View\npop-up window will indicate it as a Not Profiled area.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-06-1-1024x765.png\" alt=\"\" class=\"wp-image-10145\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">If\nthere is a Not Profiled area that even took slightly long time, then you would\nwant to be able to check what happened there, from the perspectives of\nmonitoring.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, we\ndecided to collect stacktrace for each transaction and display them in the\nreverse order of collection time.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-07-1024x675.png\" alt=\"\" class=\"wp-image-10143\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Looking\nat stacks listed in the time order, we can check what happened ion each\ntransaction. <br>\nIn the above screenshot, most of transactions seem to consistently call the\nThread.sleep() method.<br>\nWe can guess that the developer intentionally inserted it to implement a demo\nenvironment.<br>\nBy profiling the method of complied class in jsp, you can just check that the\njspService method took long time, but you wouldn\u2019t be able to assess the actual\ncause until you check the actual codes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Visualizing multiple stacktraces collected from transactions<br><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In the previous example, as transactions run relatively simple tasks, the list of stacktrace can help you roughly understand the cause.<br> However, if we assume that transaction runs for a long time and it has about 100 stacktraces collected, then it would be very time consuming to check each and every individual stacktrace.<br> JENNIFER provides two different viewing functions that can facilitate easy analysis in such situations.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Summary viewing<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Summary viewing involves analyzing and summarizing the method call relations and displaying the results in trees. Each square bar shown as tree represents a method within a stacktrace and it has three sets of information as follows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Response time<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Response\ntime is measured if it appears at least once within a stacktrace.<br>\nIt is calculated based on the formula: number of appearance x stacktrace\nmeasurement period. A method with long response time can be concluded as an\nentry point to the bottleneck of the system performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Self Time<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Self\ntime is measured when the method is located at the top of stacktrace. In other\nwords, it is the currently running method. The greater the number is the more\nlikely it is the bottleneck of the system. Most of them are methods that\ngenerate I\/O. In some cases, they can be methods consuming lots of CPU\nresources.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Retained Self Time<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Self\ntime is measured when the method is located at the top of stacktrace. In other\nwords, it is the currently running method. The greater the number is the more\nlikely it is the bottleneck of the system. Most of them are methods that\ngenerate I\/O. In some cases, they can be methods consuming lots of CPU\nresources.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Flame Chart<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Brandon\nGregg proposed a visualization method based on charts.<br>\nA single vertical stem is a type of stacktrace. If there are multiple nodes on\ntop of node, it means that call has been branched out at that point.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Flame\nchart has the following characteristics.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Each color indicates that it is a\n     method of the same package.<\/li><li>Area size of rectangle is the\n     number of collections.<\/li><li>Method at the bottom of chart is\n     the start point of stacktrace.<\/li><li>Method at the top of chart is the\n     currently running method.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Based\non this fact, to find the most frequently called method during the period, you\nshould find the area with the largest size. The method you found is probably\nthe main cause of specific symptoms during the time (CPU usage, response time\ndelay).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Cases of Usage<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let\u2019s analyze the circumstances that developer Y was faced with by using the improved stacktrace function from JENNIFER.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First,\nlet\u2019s check the detailed information of slow transaction in the X-View pop-up\nwindow.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-08-1024x403.png\" alt=\"\" class=\"wp-image-10148\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Not Profiled\nnodes occupy most of processing time.<br>\nWe can see that the Not Profiled node has a sub node called STACK-TRACE.<br>\nThis is the result of displaying the location of stacktrace collection based on\nevery profile and time information.<br>\nThe above photo indicates that 95 stacktraces are collected in the Not Profiled\narea.<br>\nNow, click the STACK-TRACE node to move to the stacktrace tab where the matched\nstack group is automatically selected.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-09-1024x415.png\" alt=\"\" class=\"wp-image-10150\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-10-1024x595.png\" alt=\"\" class=\"wp-image-10151\"\/><figcaption>95 stacktraces are collected in the selected time section. The time displayed on the left means the stack collection time and each color indicates the type of stacktrace. Consecutive sections with same color indicates that the same method runs consecutively. <\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> In the previous time line tab, we can see that there are 95 stacktraces in the time section. (Color in front of the time indicates the type of stacktrace.)<br> If there are sections connected in same color, it means that they are collected consecutively, and we can guess that it has been running for a long time.) In other words, it is a slow method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In\nthis transaction, especially, the String.intern() method is called many times.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\ncan scroll down to find sections connected in same color, but using the\nsummary, flame graphs, you can find the method that runs for a long time much\nmore easily.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Summary Viewing<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You\ncan click the summary viewing option to check the following.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-11-1024x609.png\" alt=\"\" class=\"wp-image-10155\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The\ngraph shows a tree obtained by integrating the call relations of each method\nshown in 95 stacktraces collected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here,\nto find the slowest method or the method that runs most frequently, you should\nfind the node where the yellow bar occupies the largest area size.\nString.intern() method occupies 37.89%. (In terms of time, it took about 3.6\nsec.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\nblue color methods are the ones that include those slow methods.) From the\nperspectives of analysis, if you want to find the most frequently called method\nfirst instead of running methods, then focus on searching for these nodes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Flame graph<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Why don\u2019t\nwe check the Flame graph, now?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-12-1024x603.png\" alt=\"\" class=\"wp-image-10158\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here,\nyou can see the chart that resembles the shape of flame.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\nslowest method is the one at the top of square area, which occupies the largest\narea size. At glance, we can tell that the java.lang.String.intern() method\nruns most frequently\/<br>\nThe method in one space below is the method that called the java.lang.String.intern()\nmethod, in other words, it is the\ncom.atlassian.jira.web.bean.BackingI18n.flattenResourceBundlesToMap(BackingI18n.java:658)\nmethod.<br>\nUsing these three methods, we reached the conclusion that the method that has\nbeen running for the longest time is the String.intern method and the method\nthat called this method is the BackingI18n.flattenResourceBundlesToMap method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, I\nam curious why these methods are slow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, I want to check the BackingI18n class. Looking at the package name, it is atlassian, the code for Jira. It means that we cannot open our modify the source codes.<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> Then, let\u2019s focus on analyzing the String.intern method.<br> This is a native method that is provided by basic JDK versions. <br>If the text string sent as parameter to the text string pool managed by JVM does not exist in the text string pool, then it is inserted before being returned. Otherwise, if it does, then it is returned after finding a match in the text string pool.<br> Simply put, it prevents duplicate generation of the same text string, thus reducing the memory usage rate. By the way, it takes more than 3 seconds. Isn\u2019t it strange?  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s\nsearch for the method by keywords as follows.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/Stack-trace14-858x860.png\" alt=\"\" class=\"wp-image-10056\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Looking\nat the first search result, we can see the information about the String.intern\nmethod that is differently implemented and operated for each JDK version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/java-performance.info\/string-intern-in-java-6-7-8\/\">http:\/\/java-performance.info\/string-intern-in-java-6-7-8\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\nfollowing is a summary of the above content.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>JDK6 \u2013 Text string pool is managed\n     in the PermGen area and it is a fixed size, so you are not recommended to\n     use it. You are recommended to implement text string pool as a map for\n     use.<\/li><li>JDK7 \u2013 Text string pool is managed\n     in the heap area. The default size of 1009 up to right before jdku40.\n     Increased to 60013 at jdku40.<\/li><li>JDK8 \u2013 Text string pool is managed\n     in the heap area. Default size of 60013<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"> So, developer Y decides to check the JDK version for any luck.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/Stack-trace15-1024x172.png\" alt=\"\" class=\"wp-image-10057\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAh.. JDK version is\n1.7.0_25. \n\n\n\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If so,\nlet&#8217;s assume that the default size of text string pool is 1009 and as text\nstrings exceeding this size are accumulated, adequate hash distribution keeps\nfailing.) (Unless the data within the map is distributed by using a proper hash\nalgorithm, the more the data the slower the viewing speed gets.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If\nthis is the actual cause of performance degradation, then you can expect some\nperformance improvements simply by increasing the text string pool size.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I set\nthe text string pool size in the Jira scripts as follows. The size is same as\nthe default size of JDK8.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/Stack-trace16-1024x59.png\" alt=\"\" class=\"wp-image-10058\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now,\nlet&#8217;s restart Jira and observe what is going on.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mce_209\">About one month later<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"> After applying the option, the response time of Jira has been greatly improved. Now, as I am about to close the chapters, I can feel very good, which cannot be compared to the previous time (Of course, depending on persons, the level of performance improvement might vary little.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Just\nin case, I have collected and recorded the performance information before\nchanging the settings. I was curious how much improvement there actually\nexisted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> I felt improvements but I wanted to verify them with numbers. So, I compared the previous and current status by using the application status, performance browser functions and so on.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Application status<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The\nfollowing results are call counts sorted in the descending order.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-13-1-1024x654.png\" alt=\"\" class=\"wp-image-10163\"\/><figcaption>&lt;Before improvment&gt;<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-14-1-1024x653.png\" alt=\"\" class=\"wp-image-10164\"\/><figcaption>&lt;after improvment&gt;<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">At\nglance, we can see that the average and max response times are improved.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. Performance brwoser<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Response time<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This\ntime, we have drawn comparisons of several factors that can affect the\nperformance by using the performance browser function.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-15-1024x631.png\" alt=\"\" class=\"wp-image-10166\"\/><figcaption>The green color indicates the existing status. <br>The purple color indicates one month after it is applied. <\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The\ngreen color indicates the existing status. The purple color indicates one month\nafter it is applied. We can see that there is overall improvement of general\nsituation or peak time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CPU time per transaction<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-16-1024x632.png\" alt=\"\" class=\"wp-image-10167\"\/><figcaption>Sky color line indicates the time before improvement while the purple color indicates the time after improvement. <\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nSky color line indicates\nthe time before improvement while the purple color indicates the time after\nimprovement.<br>\nWe can see here as well that the CPU time per transaction is greatly reduced\nafter improvement.\n\n\n\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> Improvement you feel is proven with actual futures!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. X-View<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-17-1024x632.png\" alt=\"\" class=\"wp-image-10170\"\/><figcaption>&lt;Before improvment&gt;<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/10\/image-18-1024x643.png\" alt=\"\" class=\"wp-image-10171\"\/><figcaption>&lt;After improvment&gt;<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> Finally, we compared data on the X-View chart before and after improvement is made.<br> We can check that there are more densely populated transactions at the bottom. It means that the overall response time is improved.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I was\nlittle worried before introducing you to the improved stacktrace function.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is because it was very hard for me to find a good example to help you understand the effects of sampling based analysis function that I experienced.<br>Thanks to the installation type of Jira software (issue management system) where the performance periodically degrades, fortunately, I was able to find a good example to explain the performance improvement in an actual system to users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>In our example, using a general method profiling based method, it would be very hard to derive the results we obtained.<br>Profiling the java.lang package is not a good approach. The problematic String.intern method is not a native method. That is why.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, I would like to close our chapters, wishing that the JENNIFER function that I just discussed can be helpful in resolving performance issues that you might have overlooked or even given up.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"text-align:center\"><em>JENNIFER is preparing an analysis function based on the stacktrace of entire system beside stacktrace of individual transactions. The function will greatly help you in resolving performance issues that cannot be analyzed from the transaction perspectives. So, you may be full of high anticipations<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n","protected":false},"excerpt":{"rendered":"The J company that developer Y works for is using an old version of installation type of Jira software Although&#8230;","protected":false},"author":18,"featured_media":2623,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[78],"tags":[],"class_list":["post-2610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech"],"acf":[],"_links":{"self":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts\/2610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/comments?post=2610"}],"version-history":[{"count":5,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts\/2610\/revisions"}],"predecessor-version":[{"id":2621,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts\/2610\/revisions\/2621"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/media\/2623"}],"wp:attachment":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/media?parent=2610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/categories?post=2610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/tags?post=2610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}