1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.buffer;
17
18 import jdk.jfr.DataAmount;
19 import jdk.jfr.Description;
20 import jdk.jfr.MemoryAddress;
21
22 @SuppressWarnings("Since15")
23 abstract class AbstractChunkEvent extends AbstractAllocatorEvent {
24 @DataAmount
25 @Description("Size of the chunk")
26 public int capacity;
27 @Description("Is this chunk referencing off-heap memory?")
28 public boolean direct;
29 @Description("The memory address of the off-heap memory, if available")
30 @MemoryAddress
31 public long address;
32
33 public void fill(ChunkInfo chunk, AllocatorType allocatorType) {
34 this.allocatorType = allocatorType;
35 capacity = chunk.capacity();
36 direct = chunk.isDirect();
37 address = chunk.memoryAddress();
38 }
39 }