- Oracle SOA Suite 11g Performance Tuning Cookbook
- Matthew Brasier Nicholas Wright
- 474字
- 2021-08-13 16:51:39
Identifying permanent generation problems with jstat
The permanent generation is a special part of the HotSpot JVM's memory, which stores "class templates"' for the JVM class loader to use when creating and removing objects.
jstat is a JVM command-line tool, which shows you a number of statistics regarding how the JVM is performing.
In this recipe, we use jstat to understand the size of the permanent generation.
Getting ready
You will need SOA Suite installed for this recipe, and will need permission to execute the domain control scripts, as well as the HotSpot JVM tools. This recipe assumes that your SOA Suite application is running such that we may run jstat against it.
The tools jps
and jstat
are included with both the HotSpot and JRockit JVMs. For brevity, this recipe assumes that you have the relevant bin
directory on your path. If you do not, simply use the fully qualified paths to the relevant bin directory.
This recipe assumes you are using HotSpot, as JRockit does not have a permanent generation.
How to do it…
- Use JPS to determine the process ID of your SOA Suite server; see step 1 of the Identifying New Size problems with jstat recipe.
- Use the
jstat
command to view the sizes of the survivor spaces and Eden:jstat -gc -h10 <pid> 2000
The metrics we are interested in are
PC
andPU
.PC
is the capacity (size) of the permanent generation (in KB), andPU
is the utilization of the permanent generation (in KB). - We want to see that
PU
is around 80 percent or less ofPC
.
How it works…
jstat is a JVM tool that can be used to view a number of runtime statistics regarding the JVM. The option –gc
printsthe statistics about garbage collection, including the capacity and utilization of each memory pool. In the preceding example, the parameter –h10
prints the headers every 10 lines, to make the output easier to read, and 2000
is the time in milliseconds between each sample (2 seconds).
Permanent generation is the section of JVM memory that is used to store classes and other objects that cannot be represented as Java types. The larger a SOA Suite application is, the more classes it will contain, and the more permanent generation it will need. If the permanent generation is too small, classes will need to be unloaded and reloaded in the permanent generation, causing full garbage collections to occur, and a performance hit. We want permanent generation to be large enough to hold all the classes in your SOA Suite application, with a little overhead for other resources, so if the utilization of the permanent generation is around 80 percent of its capacity, we should have sufficient overhead to prevent classes needing to be unloaded.
See also
- The Setting the permanent generation size recipe
- 智慧城市:大數據、互聯網時代的城市治理(第4版)
- FreeSWITCH 1.2
- Go Web Scraping Quick Start Guide
- SSL VPN : Understanding, evaluating and planning secure, web/based remote access
- 2018網信發展報告
- 中國互聯網發展報告2018
- 網絡安全應急響應技術實戰指南
- 網絡綜合布線(第2版)
- 網絡空間全球治理觀察
- 數據血緣分析原理與實踐
- 基于IPv6的家居物聯網開發與應用技術
- Qt5 Python GUI Programming Cookbook
- Guide to NoSQL with Azure Cosmos DB
- 世界互聯網發展報告2021
- 物聯網,So Easy!