Skip to content

A 1.4 MB ods grows past 1.2 GB in Html::translate and the OS kills the app #762

Description

@andiwand

odr-public/odr-private corpus file odr-private/ods/efficiency-big-1.ods (1,401,603 bytes) takes the whole process down while translating. Found sweeping the corpus for the OpenDocument.droid 6.11.0 bump; it is not a 6.11.0 regression — 6.10.1 behaves the same.

What happens

Resident memory of the app process, sampled every 0.3 s from /proc/<pid>/status on a 2 GB device with 819 MB available at the start:

RSS device MemAvailable
99 MB 819 MB
218 MB 791 MB
439 MB 579 MB
863 MB 155 MB
1071 MB 0
1188 MB 12 MB
killed by lmkd

Roughly 850x the file size, still climbing when it died, so 1.19 GB is a floor rather than the requirement. lowmemorykiller takes it — there is no OutOfMemoryError, and the JVM heap growth limit on this device is 192 MB, so this is native allocation.

It dies after the file type is known and before any view exists, i.e. inside Html::translate.

The html limits do not bound it

HtmlConfig::spreadsheet_limit and spreadsheet_cell_limit bound what is written, not what is read to get there, so no setting of them helps:

rows / cells result
100000 / 500000 (6.11.0 defaults) killed
10000 / unset (the 6.10.x shape) killed
100 / 2000 killed

The last row is the interesting one: a 100-row, 2000-cell budget still costs over a gigabyte, which says the cost is in parsing the sheet rather than emitting it.

Reproducing

Any host will do; this was an Android app calling Html.translate through the JNI bindings.

Odr.open("efficiency-big-1.ods") -> ok
Html.translate(file, cache, config)  // config limits irrelevant, see above

Versions

  • 6.11.0 (3fa5603c) and 6.10.1, identical behaviour
  • Android 12 emulator, x86_64, 2 GB RAM

Note

A second corpus file, odr-private/ods/efficiency+style-big-1.ods (33,038 bytes), survives on its own but was killed when opened after other large documents in the same sweep — consistent with the same allocation pattern at a smaller scale.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions