From ec8c25b4e2d85970e1af4a9e6daed25d088ee497 Mon Sep 17 00:00:00 2001 From: 8ga Date: Fri, 14 Mar 2025 15:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20JFR/3=5FEvent=E9=87=87?= =?UTF-8?q?=E9=9B=86=E8=AF=A6=E7=BB=86=E9=85=8D=E7=BD=AE.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JFR/3_Event采集详细配置.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/JFR/3_Event采集详细配置.md b/JFR/3_Event采集详细配置.md index 48cc867..ea0aa53 100644 --- a/JFR/3_Event采集详细配置.md +++ b/JFR/3_Event采集详细配置.md @@ -24,4 +24,16 @@ TLAB 目的是为了快速分配内存。堆内存是线程共享的,所以在 *ObjectAllocationOutsideTLAB*在 default.jfc 中也是默认关闭的,可以通过向导配置*memory-profiling*调为*memory-profiling-enabled-medium*打开。也可以用高级配置这个 Event 是否采集,以及堆栈是否采集。采集内容包括:时间、线程、本次需要分配内存大小、对象类型。 -**这两个的采集,对性能影响比较大,不能长期跑。尤其是在启用堆栈收集后,影响就更大了。一般考虑动态打开。** \ No newline at end of file +**这两个的采集,对性能影响比较大,不能长期跑。尤其是在启用堆栈收集后,影响就更大了。一般考虑动态打开。**如果需要定位大对象分配代码位置,可以采集一个时间段的*ObjectAllocationOutsideTLAB*查看最大需要的内存大小是多少,通过减少内存分配来减少GC。或者查看造成这些事件的热点堆栈是哪里,然后优化代码。示例打开配置: + +```xml + + true + true + + + + true + true + +``` \ No newline at end of file