There are three components of the JVM that are focused on when tuning performance. The heap is where your object data is stored. This area is then managed by the garbage collector selected at startup. Most tuning options relate to sizing the heap and choosing the most appropriate garbage collector for your situation. The JIT compiler also has a big impact on performance but rarely requires tuning with the newer versions of the JVM.
JVM的三个组件主要在调整性能时着重。 * heap *是存储对象数据的位置。 然后,该区域由启动时选择的垃圾收集器管理。 大多数调整选项都与确定堆大小和为您的情况选择最合适的垃圾收集器有关。 JIT编译器对性能也有很大的影响,但很少需要使用JVM的较新版本进行调整。
Performance Basics
Typically, when tuning a Java application, the focus is on one of two main goals: responsiveness or throughput. We will refer back to these concepts as the tutorial progresses.
性能基础
通常,在调整Java应用程序时,重点放在两个主要目标之一:响应性或吞吐量。 随着教程的进行,我们将再次参考这些概念。
Responsiveness
Responsiveness refers to how quickly an application or system responds with a requested piece of data. Examples include:
How quickly a desktop UI responds to an event
How fast a website returns a page
How fast a database query is returned
For applications that focus on responsiveness, large pause times are not acceptable. The focus is on responding in short periods of time.
响应能力
响应能力是指应用程序或系统对请求的数据片段做出响应的速度。 示例包括:
-桌面用户界面对事件的响应速度
-网站返回网页的速度
-返回数据库查询的速度
对于注重响应性的应用程序,较长的暂停时间是不可接受的。 重点是在短时间内做出响应。
Throughput
Throughput focuses on maximizing the amount of work by an application in a specific period of time. Examples of how throughput might be measured include:
The number of transactions completed in a given time.
The number of jobs that a batch program can complete in an hour.
The number of database queries that can be completed in an hour.
High pause times are acceptable for applications that focus on throughput. Since high throughput applications focus on benchmarks over longer periods of time, quick response time is not a consideration.
吞吐量吞吐量侧重于最大程度地提高应用程序在特定时间段内的工作量。 如何测量吞吐量的示例包括:
在给定时间内完成的交易数量。
批处理程序在一小时内可以完成的作业数。
一小时内可以完成的数据库查询数。
对于注重吞吐量的应用程序来说,高暂停时间是可以接受的。 由于高吞吐量应用程序会在更长的时间内关注基准测试,因此不考虑快速响应时间。
The G1 Garbage Collector