Repository navigation
Cap deserialized LocalCache+MapMakerInternalMap concurrency level at 1024. - #8714
Merged
Merged
Conversation
… at 1024. 1024 ought to be enough for anybody. And probably few people are serializing caches or weak-entry-based maps, anyway. And people should be using [Caffeine](https://github.com/ben-manes/caffeine). There was already a cap of 64k, so these collections didn't permit arbitrary-sized allocations. Still, the reduction brings them more in line with what is already possible when deserializing built-in JDK types. See, for example, [`LogRecord`](https://github.com/openjdk/jdk/blob/4e8bec6f862b58732537dea15cb3dd50a01fede0/src/java.logging/share/classes/java/util/logging/LogRecord.java#L704) and [`ZoneRules`](https://github.com/openjdk/jdk/blob/4e8bec6f862b58732537dea15cb3dd50a01fede0/src/java.base/share/classes/java/time/zone/ZoneRules.java#L464) (though the constant factors are still different). (If any user of the classes is directly passing a concurrency level of more than 1024, it's extremely likely that that user would be better off if we were to cap it to 1024 in that code path, too. But I'm not bothering in this CL.) RELNOTES=n/a PiperOrigin-RevId: 993749847
copybara-service
Bot
force-pushed
the
test_993648446
branch
from
October 5, 2026 16:58
1c79086 to
81c7d03
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cap deserialized
LocalCache+MapMakerInternalMapconcurrency level at 1024.1024 ought to be enough for anybody. And probably few people are serializing caches or weak-entry-based maps, anyway. And people should be using Caffeine.
There was already a cap of 64k, so these collections didn't permit arbitrary-sized allocations. Still, the reduction brings them more in line with what is already possible when deserializing built-in JDK types. See, for example,
LogRecordandZoneRules(though the constant factors are still different).(If any user of the classes is directly passing a concurrency level of more than 1024, it's extremely likely that that user would be better off if we were to cap it to 1024 in that code path, too. But I'm not bothering in this CL.)
RELNOTES=n/a