在JDK 1.4 中新加入NIO (New Input/Output) 类,引入了一种基于通道(Channel)和缓存(Buffer)的 I/O 方式,它可以使用 Native 函数库直接分配堆外内存,然后通过一个存储在 Java 堆中的 DirectByteBuffer 对象作为这块内存的引用进行操作。可以避免在 Java 堆和 Native 堆中来回的数据耗时操作。 OutOfMemoryError:...
jvm_gc_max_data_size_bytes:老年代的最大内存量 jvm_gc_live_data_size_bytes:full GC老年代的大小 jvm_threads_live_threads:当前活动线程数,包括守护程序线程和非守护程序线程 jvm_buffer_memory_used_bytes:已使用缓冲池大小 jvm_buffer_count_buffers:缓冲区数量 logback_events_total:日志备份事件总计 net_...
http://localhost:8080/actuator/metrics/jvm.buffer.memory.used?tag=id:mapped {"name":"jvm.buffer.memory.used","description":"An estimate of the memory that the Java virtual machine is using for this buffer pool","baseUnit":"bytes","measurements":[{"statistic":"VALUE","value":0}],"avai...
http://localhost:8080/actuator/metrics/jvm.buffer.memory.used... { "name": "jvm.buffer.memory.used", "description": "An estimate of the memory that the Java virtual machine is using for this buffer pool", "baseUnit": "bytes", "measurements": [ { "statistic": "VALUE", "value": 81...
http://localhost:8080/actuator/metrics/jvm.buffer.memory.used?tag=id:mapped 代码语言:javascript 复制 {"name":"jvm.buffer.memory.used","description":"An estimate of the memory that the Java virtual machine is using for this buffer pool","baseUnit":"bytes","measurements":[{"statistic":"VALU...
used是已经被使用的内存大小,committed是当前可使用的内存大小(包括已使用的),### committed >= used。 committed不足时jvm向系统申请,若超过max则发生OutOfMemoryError错误。 # HELP jvm_memory_bytes_committed Committed (bytes) of a given JVM memory area. ...
BufferPoolMXBean 及 JavaNioAccess.BufferPool (通过SharedSecrets获取) 的 getMemoryUsed 可以获取 direct memory 的大小;其中 java9 模块化之后,SharedSecrets 从原来的 sun.misc.SharedSecrets 变更到 java.base 模块下的 jdk.internal.access.SharedSecrets;要使用 --add-exports java.base/jdk.internal.access=ALL-...
那就是:Direct Buffer:直接内存 MMap Buffer:文件映射内存 这两个都可以通过 Java MBean 看到:...
我们这里由官方提供的一个查看 JVM 内存占用的工具引入,即 Native Memory Tracking。不过要注意的一点是,这个只能监控 JVM 原生申请的内存大小,如果是通过 JDK 封装的系统 API 申请的内存,是统计不到的,例如 Java JDK 中的 DirectBuffer 以及 MappedByteBuffer 这两个(当然,对于这两个,我们后面也有其他的办法去...
// The maximum amount of allocatable direct buffer memory (in bytes) // from the system property sun.nio.MaxDirectMemorySize set by the VM. // If not set or set to -1, the max memory will be used // The system property will be removed. String s = props.get("sun.nio.MaxDirec...