Skip to content

Increase chunk-size cap in Filter.decode() for large streams - #528

Open
valerybokov wants to merge 1 commit into
apache:trunkfrom
valerybokov:improve-Filter.decode
Open

Increase chunk-size cap in Filter.decode() for large streams#528
valerybokov wants to merge 1 commit into
apache:trunkfrom
valerybokov:improve-Filter.decode

Conversation

@valerybokov

Copy link
Copy Markdown

The buffer chunk-size estimate in the static decode() collapsed to the
flat 4KB default for any encoded stream >= 1KB, forcing thousands of
separate 4KB chunk allocations in RandomAccessReadWriteBuffer when
decoding large images/fonts. Cap the estimate at 1MB instead of
falling back to 4KB, cutting the number of chunk allocations for large
streams while still bounding worst-case preallocation

@valerybokov

Copy link
Copy Markdown
Author

Another question. It looks like the issue https://issues.apache.org/jira/browse/PDFBOX-5491 is okay now. Some code fixed a problem.

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

Successfully merging this pull request may close these issues.

1 participant