{"record":{"id":"6db157e16b3df7f4","repo":"apache/dubbo","slug":"no-more-memory-can-be-used","errorCode":null,"errorMessage":"no more memory can be used !","messagePattern":"no more memory can be used !","errorType":"exception","errorClass":"RejectException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/concurrent/AbortPolicy.java","lineNumber":28,"sourceCode":" *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.dubbo.common.concurrent;\n\nimport java.util.Queue;\n\n/**\n * A handler for rejected element that throws a {@code RejectException}.\n */\npublic class AbortPolicy<E> implements Rejector<E> {\n\n    @Override\n    public void reject(final E e, final Queue<E> queue) {\n        throw new RejectException(\"no more memory can be used !\");\n    }\n}\n","sourceCodeStart":10,"sourceCodeEnd":31,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/concurrent/AbortPolicy.java#L10-L31","documentation":"Thrown by AbortPolicy.reject when a bounded queue rejects an element, wrapped in a RejectException. AbortPolicy is the default rejection handler for Dubbo's concurrent queues; it aborts rather than blocking or dropping, signalling that the queue/executor cannot accept more work.","triggerScenarios":"A Rejector-backed queue (e.g. a Dubbo serialization/processing queue) is full or has been shut down, and AbortPolicy is the configured rejection policy. The reject() method unconditionally throws RejectException.","commonSituations":"Backpressure: the producer is faster than the consumer and the bounded queue saturates. Thread pool or queue capacity is too small for the load. A downstream stage is stalled, causing upstream queues to fill.","solutions":["Increase the queue/pool capacity to match the expected throughput.","Switch to a different Rejector (e.g. CallerRunsPolicy-style) if blocking the producer is acceptable.","Add backpressure or rate-limiting at the producer to prevent saturation.","Investigate downstream stalls that cause the queue to fill and fix the slow consumer."],"exampleFix":"// before\nnew AbortPolicy<>(); // throws on saturation\n// after\nnew CallerRunsPolicy<>(); // or size the queue to load\nnew LinkedBlockingQueue<>(10000);","handlingStrategy":"try-catch","validationCode":"// Before enqueueing, check remaining capacity\nif (queue.remainingCapacity() > 0) {\n    queue.offer(e);\n} else {\n    // apply backpressure or resize the queue\n}","typeGuard":"static boolean hasCapacity(Queue<?> q, int capacity) {\n    return q.size() < capacity;\n}","tryCatchPattern":"try {\n    rejector.reject(e, queue);\n} catch (RejectException ex) {\n    // queue saturated; back off, resize, or use a different policy\n}","preventionTips":["Size queues and thread pools to expected throughput.","Choose a rejection policy that fits your backpressure needs (e.g. caller-runs).","Add rate limiting at producers to avoid saturation.","Monitor and fix slow consumers that cause queues to fill."],"tags":["concurrency","queue","backpressure","thread-pool"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}