{"record":{"id":"e2246eb2fc7c0da5","repo":"apache/shenyu","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":"shenyu-common/src/main/java/org/apache/shenyu/common/concurrent/AbortPolicy.java","lineNumber":30,"sourceCode":" * 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 */\n\npackage org.apache.shenyu.common.concurrent;\n\nimport java.util.Queue;\n\n/**\n * A handler for rejected element that throws a\n * {@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":12,"sourceCodeEnd":33,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-common/src/main/java/org/apache/shenyu/common/concurrent/AbortPolicy.java#L12-L33","documentation":"AbortPolicy is a Rejector for Shenyu's concurrent task queues: when a producer submits an element and the queue/pool cannot accept it, reject() unconditionally throws RejectException with 'no more memory can be used !'. It signals that the caller is outpacing consumers and the configured back-pressure policy is to abort rather than block or discard.","triggerScenarios":"Calling put/offer on a shenyu-disruptor-style queue (e.g. the admin register event producer) whose reject policy is AbortPolicy while the queue and its memory budget are exhausted.","commonSituations":"Bursts of client registrations exceeding consumer throughput in shenyu-admin; consumers stuck/slow (e.g. slow DB writes) letting the in-memory queue fill; undersized queue capacity configuration.","solutions":["Reduce producer rate or batch the work being enqueued.","Investigate why consumers are slow (DB latency, lock contention) and fix the bottleneck.","Increase queue capacity / memory budget if the burst is expected and transient.","Choose a different Rejector policy (e.g. blocking or caller-runs style) if aborting is unacceptable for the workload."],"exampleFix":"// before\nnew DisruptorProvider<>(..., new AbortPolicy<>(), ...); // producer aborts on burst\n// after\nnew DisruptorProvider<>(..., new BlockingPolicy<>(), ...); // producers block instead of aborting","handlingStrategy":"try-catch","validationCode":"if (queue.remainingCapacity() <= 0) {\n    LOG.warn(\"queue saturated, applying backpressure before produce\");\n    // shed, batch, or block before producing\n}","typeGuard":null,"tryCatchPattern":"try {\n    provider.put(event);\n} catch (RejectException e) {\n    LOG.error(\"Event dropped, queue exhausted: {}\", e.getMessage());\n    metrics.increment(\"register.queue.rejected\");\n}","preventionTips":["Monitor queue fill levels and consumer lag in shenyu-admin.","Size queue capacity against peak registration bursts.","Pick a blocking/limiting reject policy when dropping events is unacceptable."],"tags":["concurrency","backpressure","memory","queue"],"backgroundTag":"queue-capacity-exceeded","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}