apache/dubbo · warning · IllegalStateException
URL Param Cache is full.
Error message
URL Param Cache is full.
What it means
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.
Source
Thrown at dubbo-common/src/main/java/org/apache/dubbo/common/url/component/param/DynamicValues.java:44
public DynamicValues(String defaultVal) {
if (defaultVal == null) {
indexSeq += 1;
} else {
add(defaultVal);
}
}
public int add(String value) {
Integer index = value2Index.get(value);
if (index != null) {
return index;
} else {
synchronized (this) {
// thread safe
if (!value2Index.containsKey(value)) {
if (indexSeq == Integer.MAX_VALUE) {
throw new IllegalStateException("URL Param Cache is full.");
}
// copy on write, only support append now
String[] newValues = new String[indexSeq + 1];
System.arraycopy(index2Value, 0, newValues, 0, indexSeq);
newValues[indexSeq] = value;
index2Value = newValues;
value2Index.put(value, indexSeq);
indexSeq += 1;
}
}
}
return value2Index.get(value);
}
@Override
public String getN(int n) {
if (n == -1) {
return null;View on GitHub (pinned to 3a3043227f)
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.
Defensive patterns
Strategy: fallback
Try / catch
try {
values.add(v);
} catch (IllegalStateException e) {
if ("URL Param Cache is full.".equals(e.getMessage())) {
// effectively unreachable; reset framework cache or restart
} else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Cannot found key in url param:{key}
- the array size of values should be larger than 0
- unrecognized value {value} , please check if value is illega
- Failed to release cache path's lock file:{}
- No instance of 'FileCacheStoreFactory' for you!
AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14).
Data as JSON: /api/errors/19003eaaa5928a3b.
Report an issue: GitHub.