E
- 元素类型public class MemorySafeLinkedBlockingQueue<E> extends CheckedLinkedBlockingQueue<E>
LinkedBlockingQueue
,可以解决OOM问题。此类来自于: Apache incubator-shenyu
checker
Constructor and Description |
---|
MemorySafeLinkedBlockingQueue(Collection<? extends E> c,
long maxFreeMemory)
构造
|
MemorySafeLinkedBlockingQueue(long maxFreeMemory)
构造
|
Modifier and Type | Method and Description |
---|---|
long |
getMaxFreeMemory()
get the max free memory.
|
void |
setMaxFreeMemory(int maxFreeMemory)
set the max free memory.
|
offer, offer, put
clear, contains, drainTo, drainTo, iterator, peek, poll, poll, remainingCapacity, remove, size, spliterator, take, toArray, toArray, toString
add, addAll, element, remove
containsAll, isEmpty, removeAll, retainAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, stream
public MemorySafeLinkedBlockingQueue(long maxFreeMemory)
maxFreeMemory
- 最大剩余内存大小,当实际内存小于这个值时,不再加入元素public MemorySafeLinkedBlockingQueue(Collection<? extends E> c, long maxFreeMemory)
c
- 初始集合maxFreeMemory
- 最大剩余内存大小,当实际内存小于这个值时,不再加入元素Copyright © 2025. All rights reserved.