java 对象监控_有支持监测java 大对象就报警的方法么?

JDK11引入了低开销的HeapProfiling功能,通过JVMTI扩展提供采样对象分配的API,允许开发者在指定线程中对Java对象的分配进行采样。这个API包括了一个回调方法SampledObjectAlloc,详细记录了分配对象的线程、对象引用、对象类和大小。这一特性相比之前通过JMX手动监控的方式,大大降低了实现成本。
摘要由CSDN通过智能技术生成

jdk 11 引入了 低开销的 Heap Profiling

具体api如下The user facing API for the heap sampling feature proposed here consists of an extension to JVMTI that allows for heap profiling. The following systems rely on an event notification system that would provide a callback such as:

void JNICALL

SampledObjectAlloc(jvmtiEnv *jvmti_env,

JNIEnv* jni_env,

jthread thread,

jobject object,

jclass object_klass,

jlong size)

where:

thread is the thread allocating the jobject,

object is the reference to the sampled jobject,

object_klass is the class for the jobject, and

size is the size of the allocation.

JEP 331: Low-Overhead Heap Profiling

jdk11前开发的话成本比较高,需要从jmx端口映射jvm手动做监控,实现成本相对高。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值