Repository navigation
Conversation
processLineArts copied the window's whole operator list onto every line chunk in it: L lines times P paint operators StreamInfo objects. A window is everything painted between two text or XObject boundaries, so one chart drawn without text in between reaches thousands of both. A 55-page paper (one form with 7,500 strokes) made 56 million copies and ran out of a 2 GB heap in parseChunks; a 2.6 MB document made 325 million and failed at 5 GB. Over a 200-document corpus, 5 documents needed more than 2 GB for these copies alone. A line now carries one StreamInfo, for its own paint operator, and the full list goes once onto the window's LineArtChunk, as it already did. Memory is L + P instead of L x P. This changes what a consumer sees on a line, and one relies on it: odl-pdfua's SemanticMapper builds a figure from a region's lines and needs the whole window, curves and fills included. It is changed alongside to find the window's LineArtChunk through the line's operator, and through the box when the key is ambiguous (a form drawn twice, or two forms sharing a resource name). Land that change before this one ships. Only data-loader mode is affected (StaticContainers.isDataLoader), so validation is unchanged. opendataloader-pdf's own tagger does not read line art stream infos: its tagged PDFs are byte-identical before and after on the documents that completed before, and the two that did not now complete in under 300 MB. Not changed here: parseLineArts, used when MCIDs are not ignored (core's --use-struct-tree), still copies the stream's unmarked operators onto every separate box, boxes x operators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bundolee
marked this pull request as ready for review
October 20, 2026 09:39
Contributor
|
@bundolee The jakarta branch automatically pulls in changes from integration. |
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.
Summary
ChunkParser.processLineArtscopies the window's full paint-operatorStreamInfolist onto every line chunk in the window. A window is everything painted between two text or XObject boundaries, so this makes L lines × P operators objects. A chart drawn without text in between reaches thousands of both:parseChunks.The copying came in with 5d59d2d (integration) and e4ddb18 (jakarta).
Change
processLineChunk: when MCIDs are ignored and data-loader mode is on, a line chunk gets oneStreamInfo, for the operator that painted it.processLineArts: the L × P copy loop is removed. The window'sLineArtChunkstill gets the full list, once.Memory goes from L × P to L + P. Validation mode is unchanged (
StaticContainers.isDataLoadergate).Dependency
The change alters what a consumer sees on a line chunk. One consumer relies on the old shape: odl-pdfua's
SemanticMapperbuilds figures from lines and needs the whole window. opendataloader-project/odl-pdfua#171 changes it to find the window'sLineArtChunkthrough the line's operator. That PR is merged and released in odl-pdfua 0.2.15, so this change can ship.Evidence
The diff was applied to v1.31.200 and jakarta-v1.31.177, and only
ChunkParser.classwas replaced in the runtime jars. Runs usedOpenDataLoaderPDF.processFilewith a tagged-PDF config, in a 4 GB container.-Xmx2048m-Xmx2048m-Xmx1g)Review notes
action_requiredhere with no analysis output, but on Give each line chunk only the operator that painted it #759 it reports no issues. This looks like a Codacy setup for thejakartabranch, not a code finding.LineArtChunkinstead.wcag-validationhas no test module, so no regression test was added.parseLineArtspath (MCIDs not ignored), line chunks now also get their own operator. Nothing reads them there.parseLineArtsstill copies the stream's unmarked operators onto every separate box (boxes × operators).🤖 Generated with Claude Code