Record Class LeakReport
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.leak.LeakReport
- Record Components:
name- the name of the leaked ClassLoader | 泄漏的 ClassLoader 名称level- the detection level used | 使用的检测级别creationStack- the stack trace at creation time, or empty array if level is SIMPLE | 创建时的栈轨迹,如果级别为 SIMPLE 则为空数组loadedClassCount- the number of classes loaded at tracking time | 追踪时已加载的类数量createdAtNanos- the creation timestamp in nanoseconds (System.nanoTime) | 创建时间戳(纳秒,System.nanoTime)
public record LeakReport(String name, LeakDetection level, StackTraceElement[] creationStack, int loadedClassCount, long createdAtNanos)
extends Record
Immutable report of a detected ClassLoader leak
检测到的 ClassLoader 泄漏的不可变报告
Contains diagnostic information about a ClassLoader that was garbage-collected without being explicitly closed, indicating a potential resource leak.
包含未显式关闭就被垃圾回收的 ClassLoader 的诊断信息, 表明存在潜在的资源泄漏。
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是 (不可变记录)
- Since:
- JDK 25, opencode-base-classloader V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLeakReport(String name, LeakDetection level, StackTraceElement[] creationStack, int loadedClassCount, long createdAtNanos) Compact constructor with validation 带验证的紧凑构造器 -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecreatedAtNanosrecord component.Returns a defensive copy of the creation stack trace 返回创建栈轨迹的防御性副本booleanCustom equals that compares creationStack by content 自定义 equals,按内容比较 creationStackinthashCode()Custom hashCode consistent with equals 与 equals 一致的自定义 hashCodelevel()Returns the value of thelevelrecord component.intReturns the value of theloadedClassCountrecord component.name()Returns the value of thenamerecord component.toString()Format the leak report as a human-readable string 将泄漏报告格式化为人类可读的字符串
-
Constructor Details
-
LeakReport
public LeakReport(String name, LeakDetection level, StackTraceElement[] creationStack, int loadedClassCount, long createdAtNanos) Compact constructor with validation 带验证的紧凑构造器- Throws:
NullPointerException- if name, level or creationStack is null | 当 name、level 或 creationStack 为 null 时IllegalArgumentException- if loadedClassCount is negative | 当 loadedClassCount 为负数时
-
-
Method Details
-
creationStack
Returns a defensive copy of the creation stack trace 返回创建栈轨迹的防御性副本- Returns:
- copy of the creation stack trace | 创建栈轨迹的副本
-
toString
-
equals
-
hashCode
-
name
-
level
-
loadedClassCount
public int loadedClassCount()Returns the value of theloadedClassCountrecord component.- Returns:
- the value of the
loadedClassCountrecord component
-
createdAtNanos
public long createdAtNanos()Returns the value of thecreatedAtNanosrecord component.- Returns:
- the value of the
createdAtNanosrecord component
-