Skip to content

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

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

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.

@THausherr

Copy link
Copy Markdown
Contributor

PDFBOX-5491 still happens for me.

@valerybokov

Copy link
Copy Markdown
Author

PDFBOX-5491 still happens for me.

Okay. I'll check one more time.

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.

2 participants