1
1
/*
2
- * Copyright (c) 2000, 2020 , Oracle and/or its affiliates.
2
+ * Copyright (c) 2000, 2025 , Oracle and/or its affiliates.
3
3
*
4
4
* Licensed under the Universal Permissive License v 1.0 as shown at
5
- * http ://oss.oracle.com/licenses/upl.
5
+ * https ://oss.oracle.com/licenses/upl.
6
6
*/
7
7
package com .oracle .coherence .common .internal .io ;
8
8
9
9
import com .oracle .coherence .common .collections .WeakIdentityHashMap ;
10
10
11
11
import com .oracle .coherence .common .io .BufferManagers ;
12
12
13
+ import com .oracle .coherence .common .util .SafeClock ;
14
+
15
+ import java .lang .management .GarbageCollectorMXBean ;
16
+ import java .lang .management .ManagementFactory ;
17
+
13
18
import java .lang .ref .WeakReference ;
14
19
20
+ import java .lang .reflect .InvocationTargetException ;
21
+ import java .lang .reflect .Method ;
22
+
15
23
import java .nio .ByteBuffer ;
16
24
17
25
import java .util .BitSet ;
18
26
import java .util .HashSet ;
19
27
import java .util .List ;
20
28
import java .util .Map ;
21
29
22
- import com .oracle .coherence .common .util .SafeClock ;
23
-
24
- import java .lang .management .GarbageCollectorMXBean ;
25
- import java .lang .management .ManagementFactory ;
26
-
27
30
import java .util .concurrent .ThreadLocalRandom ;
28
31
import java .util .concurrent .atomic .AtomicLong ;
29
- import java .util .function .Consumer ;
30
32
31
- import java .lang .reflect .InvocationTargetException ;
32
- import java .lang .reflect .Method ;
33
+ import java .util .function .Consumer ;
33
34
34
35
import java .util .logging .Level ;
35
36
36
-
37
37
/**
38
38
* The SlabBufferManager is a BufferManager which allocates buffers in large slabs which are then sliced into smaller
39
39
* ByteBuffers.
@@ -134,7 +134,7 @@ protected boolean allocateGenerationBuffers(int nGen, int cbBuffer)
134
134
f_cReclaimed .addAndGet (getGenerationSize ());
135
135
LOGGER .log (Level .WARNING , getName () + " replenished leaked segment '" + getBufferSize ()
136
136
+ "' slab for generation " + i +
137
- "; set the com.oracle.common.io.BufferManagers.checked system property to true to help identify leak suspects" );
137
+ "; set the com.oracle.coherence. common.io.BufferManagers.checked system property to true to help identify leak suspects" );
138
138
}
139
139
}
140
140
@@ -144,7 +144,7 @@ protected boolean allocateGenerationBuffers(int nGen, int cbBuffer)
144
144
if (!slab .ensure ())
145
145
{
146
146
// revive generation that was never fully released
147
- LOGGER .log (Level .FINE , getName () + " reviving segment '" + getBufferSize () + "' slab for generation "
147
+ LOGGER .log (Level .FINEST , getName () + " reviving segment '" + getBufferSize () + "' slab for generation "
148
148
+ nGen );
149
149
}
150
150
// else; new memory allocation
@@ -172,7 +172,7 @@ protected ByteBuffer allocateNonPooledBuffer()
172
172
LOGGER .log (Level .WARNING , getName () + " detected leaked segment '" + getBufferSize ()
173
173
+ "' slab for generation " + GEN_ID_UNPOOLED + "; " + slab .f_afOutstanding .cardinality () +
174
174
" of " + f_cBufferGen + " buffers were leaked" +
175
- "; set the com.oracle.common.io.BufferManagers.checked system property to true to help identify leak suspects" );
175
+ "; set the com.oracle.coherence. common.io.BufferManagers.checked system property to true to help identify leak suspects" );
176
176
}
177
177
// else; just a GC
178
178
}
@@ -190,7 +190,7 @@ protected ByteBuffer allocateNonPooledBuffer()
190
190
if (!slabRevive .ensure ())
191
191
{
192
192
// revive generation that was never fully released
193
- LOGGER .log (Level .FINE , getName () + " reviving segment '" + getBufferSize () + "' slab for generation "
193
+ LOGGER .log (Level .FINEST , getName () + " reviving segment '" + getBufferSize () + "' slab for generation "
194
194
+ GEN_ID_UNPOOLED );
195
195
}
196
196
@@ -205,7 +205,7 @@ protected ByteBuffer allocateNonPooledBuffer()
205
205
f_cNonPooledAllocations .incrementAndGet ();
206
206
instantiateSlab (f_cbUnpooledBuffer ).ensure (); // note: ensure inserts its buffers into the segment
207
207
208
- LOGGER .log (Level .FINE , getName () + " allocating unpooled slab for segment '" + getBufferSize ());
208
+ LOGGER .log (Level .FINEST , getName () + " allocating unpooled slab for segment '" + getBufferSize ());
209
209
210
210
buff = f_stackBuf .pop ();
211
211
}
@@ -261,7 +261,7 @@ public void dropBuffer(ByteBuffer buffer)
261
261
// we didn't produce. We have no evidence that it is the callers fault though, so we don't throw
262
262
LOGGER .log (Level .WARNING , getName () + " detected release of unknown ByteBuffer for segment '"
263
263
+ getBufferSize () + "' generation " + nGen
264
- + "; set the com.oracle.common.io.BufferManagers.checked system property to true to help identify suspects" );
264
+ + "; set the com.oracle.coherence. common.io.BufferManagers.checked system property to true to help identify suspects" );
265
265
// return and let GC deal with it
266
266
}
267
267
else if (slab .releaseSlice (buffer ))
@@ -399,7 +399,7 @@ public synchronized boolean releaseSlice(ByteBuffer buffer)
399
399
if (f_afOutstanding .isEmpty ())
400
400
{
401
401
// we've reclaimed the entire generation (slab); release it now
402
- LOGGER .log (Level .FINE , getName () + " releasing segment '" + getBufferSize ()
402
+ LOGGER .log (Level .FINEST , getName () + " releasing segment '" + getBufferSize ()
403
403
+ "' slab for generation " + decodeGeneration (f_cbSlice ));
404
404
getAllocator ().release (bufSlab );
405
405
m_weakBuf .clear ();
@@ -453,7 +453,7 @@ else if (f_cbSlice == f_cbUnpooledBuffer)
453
453
// double release of slice
454
454
LOGGER .log (Level .WARNING , getName () + " double release of '" + getBufferSize ()
455
455
+ "' buffer in generation " + decodeGeneration (f_cbSlice ) +
456
- "; set the com.oracle.common.io.BufferManagers.checked system property to true to help identify suspects" );
456
+ "; set the com.oracle.coherence. common.io.BufferManagers.checked system property to true to help identify suspects" );
457
457
}
458
458
459
459
return false ;
0 commit comments