{"record":{"id":"19003eaaa5928a3b","repo":"apache/dubbo","slug":"url-param-cache-is-full","errorCode":null,"errorMessage":"URL Param Cache is full.","messagePattern":"URL Param Cache is full\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"warning","filePath":"dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicValues.java","lineNumber":44,"sourceCode":"\n    public DynamicValues(String defaultVal) {\n        if (defaultVal == null) {\n            indexSeq += 1;\n        } else {\n            add(defaultVal);\n        }\n    }\n\n    public int add(String value) {\n        Integer index = value2Index.get(value);\n        if (index != null) {\n            return index;\n        } else {\n            synchronized (this) {\n                // thread safe\n                if (!value2Index.containsKey(value)) {\n                    if (indexSeq == Integer.MAX_VALUE) {\n                        throw new IllegalStateException(\"URL Param Cache is full.\");\n                    }\n                    // copy on write, only support append now\n                    String[] newValues = new String[indexSeq + 1];\n                    System.arraycopy(index2Value, 0, newValues, 0, indexSeq);\n                    newValues[indexSeq] = value;\n                    index2Value = newValues;\n                    value2Index.put(value, indexSeq);\n                    indexSeq += 1;\n                }\n            }\n        }\n        return value2Index.get(value);\n    }\n\n    @Override\n    public String getN(int n) {\n        if (n == -1) {\n            return null;","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicValues.java#L26-L62","documentation":"Thrown by DynamicValues.add when the per-key value cache has reached Integer.MAX_VALUE entries. DynamicValues is the dynamic (unbounded-set) ParamValue implementation that intern-distincts URL param values into a growable array indexed by integer. Reaching 2^31-1 distinct values for a single key is a guard against integer overflow, not an expected runtime condition.","triggerScenarios":"DynamicValues.add(value) is called after indexSeq has already reached Integer.MAX_VALUE, i.e. more than ~2.1 billion distinct values were interned for one param key. Each new unique value copies the backing array (copy-on-write), so this is effectively unreachable in any realistic deployment.","commonSituations":"In practice this never fires under normal load. Theoretically it could surface in a pathological long-running process generating enormous cardinality unique param values, or a memory-leak / denial-of-service where an attacker can inject unbounded distinct param values. It signals the internal cache is exhausted.","solutions":["Treat this as a resource-exhaustion / possible abuse signal: investigate why one param key accumulated billions of distinct values.","Restart the JVM to reset the per-framework cache if it is genuinely saturated.","Audit where external/untrusted values flow into URL params and bound their cardinality or canonicalize them before intern."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    values.add(v);\n} catch (IllegalStateException e) {\n    if (\"URL Param Cache is full.\".equals(e.getMessage())) {\n        // effectively unreachable; reset framework cache or restart\n    } else throw e;\n}","preventionTips":["Canonicalize/limit distinct values flowing into URL params to bound cache growth.","Treat this error as a resource-exhaustion or abuse signal, not a normal condition.","If it ever appears, investigate cardinality of a single param key before restarting."],"tags":["internal-api","param-table","resource-exhaustion","cache"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}