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, putclear, contains, drainTo, drainTo, iterator, peek, poll, poll, remainingCapacity, remove, size, spliterator, take, toArray, toArray, toStringadd, addAll, element, removecontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddaddAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, streampublic MemorySafeLinkedBlockingQueue(long maxFreeMemory)
maxFreeMemory - 最大剩余内存大小,当实际内存小于这个值时,不再加入元素public MemorySafeLinkedBlockingQueue(Collection<? extends E> c, long maxFreeMemory)
c - 初始集合maxFreeMemory - 最大剩余内存大小,当实际内存小于这个值时,不再加入元素Copyright © 2025. All rights reserved.