final class org.apache.cassandra.utils.memory.BufferPool$GlobalPool
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: org.apache.cassandra.utils.memory.BufferPool$GlobalPool
super_class: java.lang.Object
{
static final int MACRO_CHUNK_SIZE;
descriptor: I
flags: (0x0018) ACC_STATIC, ACC_FINAL
ConstantValue: 1048576
private final org.apache.cassandra.utils.memory.BufferPool$Debug debug;
descriptor: Lorg/apache/cassandra/utils/memory/BufferPool$Debug;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.util.Queue<org.apache.cassandra.utils.memory.BufferPool$Chunk> macroChunks;
descriptor: Ljava/util/Queue;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/Queue<Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;>;
private final java.util.Queue<org.apache.cassandra.utils.memory.BufferPool$Chunk> chunks;
descriptor: Ljava/util/Queue;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/Queue<Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;>;
private final java.util.concurrent.atomic.AtomicLong memoryUsage;
descriptor: Ljava/util/concurrent/atomic/AtomicLong;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
static final boolean $assertionsDisabled;
descriptor: Z
flags: (0x1018) ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=0, args_size=0
0: ldc Lorg/apache/cassandra/utils/memory/BufferPool;
invokevirtual java.lang.Class.desiredAssertionStatus:()Z
ifne 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: putstatic org.apache.cassandra.utils.memory.BufferPool$GlobalPool.$assertionsDisabled:Z
3: getstatic org.apache.cassandra.utils.memory.BufferPool$GlobalPool.$assertionsDisabled:Z
ifne 4
ldc 65536
invokestatic java.lang.Integer.bitCount:(I)I
iconst_1
if_icmpeq 4
new java.lang.AssertionError
dup
invokespecial java.lang.AssertionError.<init>:()V
athrow
4: StackMap locals:
StackMap stack:
getstatic org.apache.cassandra.utils.memory.BufferPool$GlobalPool.$assertionsDisabled:Z
ifne 5
ldc 1048576
invokestatic java.lang.Integer.bitCount:(I)I
iconst_1
if_icmpeq 5
new java.lang.AssertionError
dup
invokespecial java.lang.AssertionError.<init>:()V
athrow
5: StackMap locals:
StackMap stack:
getstatic org.apache.cassandra.utils.memory.BufferPool.DISABLED:Z
ifeq 9
6: getstatic org.apache.cassandra.utils.memory.BufferPool.logger:Lorg/slf4j/Logger;
ldc "Global buffer pool is disabled, allocating {}"
getstatic org.apache.cassandra.utils.memory.BufferPool.ALLOCATE_ON_HEAP_WHEN_EXAHUSTED:Z
ifeq 7
ldc "on heap"
goto 8
StackMap locals:
StackMap stack: org.slf4j.Logger java.lang.String
7: ldc "off heap"
StackMap locals:
StackMap stack: org.slf4j.Logger java.lang.String java.lang.String
8: invokeinterface org.slf4j.Logger.info:(Ljava/lang/String;Ljava/lang/Object;)V
goto 14
9: StackMap locals:
StackMap stack:
getstatic org.apache.cassandra.utils.memory.BufferPool.logger:Lorg/slf4j/Logger;
ldc "Global buffer pool is enabled, when pool is exhausted (max is {}) it will allocate {}"
10: getstatic org.apache.cassandra.utils.memory.BufferPool.MEMORY_USAGE_THRESHOLD:J
invokestatic org.apache.cassandra.utils.FBUtilities.prettyPrintMemory:(J)Ljava/lang/String;
11: getstatic org.apache.cassandra.utils.memory.BufferPool.ALLOCATE_ON_HEAP_WHEN_EXAHUSTED:Z
ifeq 12
ldc "on heap"
goto 13
StackMap locals:
StackMap stack: org.slf4j.Logger java.lang.String java.lang.String
12: ldc "off heap"
13: StackMap locals:
StackMap stack: org.slf4j.Logger java.lang.String java.lang.String java.lang.String
invokeinterface org.slf4j.Logger.info:(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
14: StackMap locals:
StackMap stack:
return
LocalVariableTable:
Start End Slot Name Signature
void <init>();
descriptor: ()V
flags: (0x0000)
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new org.apache.cassandra.utils.memory.BufferPool$Debug
dup
invokespecial org.apache.cassandra.utils.memory.BufferPool$Debug.<init>:()V
putfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.debug:Lorg/apache/cassandra/utils/memory/BufferPool$Debug;
2: aload 0
new java.util.concurrent.ConcurrentLinkedQueue
dup
invokespecial java.util.concurrent.ConcurrentLinkedQueue.<init>:()V
putfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.macroChunks:Ljava/util/Queue;
3: aload 0
new java.util.concurrent.ConcurrentLinkedQueue
dup
invokespecial java.util.concurrent.ConcurrentLinkedQueue.<init>:()V
putfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
4: aload 0
new java.util.concurrent.atomic.AtomicLong
dup
invokespecial java.util.concurrent.atomic.AtomicLong.<init>:()V
putfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.memoryUsage:Ljava/util/concurrent/atomic/AtomicLong;
5: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lorg/apache/cassandra/utils/memory/BufferPool$GlobalPool;
public org.apache.cassandra.utils.memory.BufferPool$Chunk get();
descriptor: ()Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=2, args_size=1
start local 0 0: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
invokeinterface java.util.Queue.poll:()Ljava/lang/Object;
checkcast org.apache.cassandra.utils.memory.BufferPool$Chunk
astore 1
start local 1 1: aload 1
ifnull 3
2: aload 1
areturn
3: StackMap locals: org.apache.cassandra.utils.memory.BufferPool$Chunk
StackMap stack:
aload 0
invokevirtual org.apache.cassandra.utils.memory.BufferPool$GlobalPool.allocateMoreChunks:()Z
ifne 0
4: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
invokeinterface java.util.Queue.poll:()Ljava/lang/Object;
checkcast org.apache.cassandra.utils.memory.BufferPool$Chunk
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lorg/apache/cassandra/utils/memory/BufferPool$GlobalPool;
1 5 1 chunk Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;
private boolean allocateMoreChunks();
descriptor: ()Z
flags: (0x0002) ACC_PRIVATE
Code:
stack=7, locals=4, args_size=1
start local 0 0: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.memoryUsage:Ljava/util/concurrent/atomic/AtomicLong;
invokevirtual java.util.concurrent.atomic.AtomicLong.get:()J
lstore 1
start local 1 1: lload 1
ldc 1048576
ladd
getstatic org.apache.cassandra.utils.memory.BufferPool.MEMORY_USAGE_THRESHOLD:J
lcmp
ifle 6
2: getstatic org.apache.cassandra.utils.memory.BufferPool.noSpamLogger:Lorg/apache/cassandra/utils/NoSpamLogger;
ldc "Maximum memory usage reached ({}), cannot allocate chunk of {}"
iconst_2
anewarray java.lang.Object
dup
iconst_0
3: getstatic org.apache.cassandra.utils.memory.BufferPool.MEMORY_USAGE_THRESHOLD:J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
dup
iconst_1
ldc 1048576
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
4: invokevirtual org.apache.cassandra.utils.NoSpamLogger.info:(Ljava/lang/String;[Ljava/lang/Object;)Z
pop
5: iconst_0
ireturn
6: StackMap locals: long
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.memoryUsage:Ljava/util/concurrent/atomic/AtomicLong;
lload 1
lload 1
ldc 1048576
ladd
invokevirtual java.util.concurrent.atomic.AtomicLong.compareAndSet:(JJ)Z
ifeq 0
end local 1 7: new org.apache.cassandra.utils.memory.BufferPool$Chunk
dup
ldc 1048576
invokestatic org.apache.cassandra.utils.memory.BufferPool.allocateDirectAligned:(I)Ljava/nio/ByteBuffer;
invokespecial org.apache.cassandra.utils.memory.BufferPool$Chunk.<init>:(Ljava/nio/ByteBuffer;)V
astore 1
start local 1 8: goto 14
end local 1 9: StackMap locals: org.apache.cassandra.utils.memory.BufferPool$GlobalPool
StackMap stack: java.lang.OutOfMemoryError
astore 2
start local 2 10: getstatic org.apache.cassandra.utils.memory.BufferPool.noSpamLogger:Lorg/apache/cassandra/utils/NoSpamLogger;
ldc "Buffer pool failed to allocate chunk of {}, current size {} ({}). Attempting to continue; buffers will be allocated in on-heap memory which can degrade performance. Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches."
iconst_3
anewarray java.lang.Object
dup
iconst_0
11: ldc 1048576
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_1
aload 0
invokevirtual org.apache.cassandra.utils.memory.BufferPool$GlobalPool.sizeInBytes:()J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
aastore
dup
iconst_2
aload 2
invokevirtual java.lang.OutOfMemoryError.toString:()Ljava/lang/String;
aastore
12: invokevirtual org.apache.cassandra.utils.NoSpamLogger.error:(Ljava/lang/String;[Ljava/lang/Object;)Z
pop
13: iconst_0
ireturn
end local 2 start local 1 14: StackMap locals: org.apache.cassandra.utils.memory.BufferPool$Chunk
StackMap stack:
aload 1
aconst_null
invokevirtual org.apache.cassandra.utils.memory.BufferPool$Chunk.acquire:(Lorg/apache/cassandra/utils/memory/BufferPool$LocalPool;)V
15: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.macroChunks:Ljava/util/Queue;
aload 1
invokeinterface java.util.Queue.add:(Ljava/lang/Object;)Z
pop
16: iconst_0
istore 2
start local 2 17: goto 23
18: StackMap locals: int
StackMap stack:
new org.apache.cassandra.utils.memory.BufferPool$Chunk
dup
aload 1
ldc 65536
invokevirtual org.apache.cassandra.utils.memory.BufferPool$Chunk.get:(I)Ljava/nio/ByteBuffer;
invokespecial org.apache.cassandra.utils.memory.BufferPool$Chunk.<init>:(Ljava/nio/ByteBuffer;)V
astore 3
start local 3 19: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
aload 3
invokeinterface java.util.Queue.add:(Ljava/lang/Object;)Z
pop
20: getstatic org.apache.cassandra.utils.memory.BufferPool.DEBUG:Z
ifeq 22
21: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.debug:Lorg/apache/cassandra/utils/memory/BufferPool$Debug;
aload 3
invokevirtual org.apache.cassandra.utils.memory.BufferPool$Debug.register:(Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;)V
end local 3 22: StackMap locals:
StackMap stack:
iload 2
ldc 65536
iadd
istore 2
StackMap locals:
StackMap stack:
23: iload 2
ldc 1048576
if_icmplt 18
end local 2 24: iconst_1
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 25 0 this Lorg/apache/cassandra/utils/memory/BufferPool$GlobalPool;
1 7 1 cur J
8 9 1 chunk Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;
14 25 1 chunk Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;
10 14 2 oom Ljava/lang/OutOfMemoryError;
17 24 2 i I
19 22 3 add Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;
Exception table:
from to target type
7 8 9 Class java.lang.OutOfMemoryError
public void recycle(org.apache.cassandra.utils.memory.BufferPool$Chunk);
descriptor: (Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
aload 1
invokeinterface java.util.Queue.add:(Ljava/lang/Object;)Z
pop
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/apache/cassandra/utils/memory/BufferPool$GlobalPool;
0 2 1 chunk Lorg/apache/cassandra/utils/memory/BufferPool$Chunk;
MethodParameters:
Name Flags
chunk
public long sizeInBytes();
descriptor: ()J
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.memoryUsage:Ljava/util/concurrent/atomic/AtomicLong;
invokevirtual java.util.concurrent.atomic.AtomicLong.get:()J
lreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/apache/cassandra/utils/memory/BufferPool$GlobalPool;
void reset();
descriptor: ()V
flags: (0x0000)
Code:
stack=3, locals=1, args_size=1
start local 0 0: goto 2
1: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
invokeinterface java.util.Queue.poll:()Ljava/lang/Object;
checkcast org.apache.cassandra.utils.memory.BufferPool$Chunk
invokevirtual org.apache.cassandra.utils.memory.BufferPool$Chunk.reset:()V
2: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.chunks:Ljava/util/Queue;
invokeinterface java.util.Queue.isEmpty:()Z
ifeq 1
3: goto 5
4: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.macroChunks:Ljava/util/Queue;
invokeinterface java.util.Queue.poll:()Ljava/lang/Object;
checkcast org.apache.cassandra.utils.memory.BufferPool$Chunk
invokevirtual org.apache.cassandra.utils.memory.BufferPool$Chunk.reset:()V
5: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.macroChunks:Ljava/util/Queue;
invokeinterface java.util.Queue.isEmpty:()Z
ifeq 4
6: aload 0
getfield org.apache.cassandra.utils.memory.BufferPool$GlobalPool.memoryUsage:Ljava/util/concurrent/atomic/AtomicLong;
lconst_0
invokevirtual java.util.concurrent.atomic.AtomicLong.set:(J)V
7: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 this Lorg/apache/cassandra/utils/memory/BufferPool$GlobalPool;
RuntimeInvisibleAnnotations:
com.google.common.annotations.VisibleForTesting()
}
SourceFile: "BufferPool.java"
NestHost: org.apache.cassandra.utils.memory.BufferPool
InnerClasses:
final Chunk = org.apache.cassandra.utils.memory.BufferPool$Chunk of org.apache.cassandra.utils.memory.BufferPool
final Debug = org.apache.cassandra.utils.memory.BufferPool$Debug of org.apache.cassandra.utils.memory.BufferPool
final GlobalPool = org.apache.cassandra.utils.memory.BufferPool$GlobalPool of org.apache.cassandra.utils.memory.BufferPool
final LocalPool = org.apache.cassandra.utils.memory.BufferPool$LocalPool of org.apache.cassandra.utils.memory.BufferPool