Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit initial allocated block size by ByteArrayBuilder to max block size #639

Closed
cowtowncoder opened this issue Sep 5, 2020 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

Although increase of block sizes is capped to 128k by ByteArrayBuilder, initial block size is not limited.
Databind used to try to allocate full block for base64 decoding, and due to miscalculation in an earlier version (up 2.9.x), was vastly overallocating, leading to potential failures.
But since builder is supposed to segment content anyway let's limit size of the initial block to strict per-block maximum: seems pointless not to do that.

@cowtowncoder cowtowncoder added this to the 2.12.0 milestone Sep 5, 2020
@cowtowncoder
Copy link
Member Author

... even better. Just realized that due to buffer recycling, use of humongous block could even retain to problematic retention.
So this may block one possible real problem too, in addition to avoiding secondary issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant