Skip to content

bug/Very High Memory Utilisation: 7mb Excel sheet taking more than 10gb memory space #3872

Closed

Description

@Akashtyagi

Describe the bug
When trying to parse and chunk a 7mb xls file, the Unstructured server takes exponential memory space and crashes for me beyond 10gb.

To Reproduce
Input file -

xlsx4.xls

with open(file_path, "rb") as f:
    files = shared.Files(
        content=f.read(),
        file_name=file_path,
    )


req = operations.PartitionRequest(
    partition_parameters=shared.PartitionParameters(
        files=files,
        chunking_strategy=ChunkingStrategy.BY_TITLE,
        strategy=PartitionStrategy.HI_RES,
        multipage_sections=False,
    )
)


try:
    start = time.time()
    elements_by_page = {}
    print("File name: ", file_path)
    partitioned_data = unstructured_client.general.partition(req)
    end = time.time() - start
    print("Time taken in seconds: ", end)
    # print("Partitioned data:", partitioned_data)
    tables = 0
    for element in partitioned_data.elements:
        if element["type"] == "Table" and element['metadata']['text_as_html'] is not None:
            tables += 1
    print("Total Table counts: ", tables)

except SDKError as sdk_error:
    raise sdk_error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Image

Environment Info
Please run python scripts/collect_env.py and paste the output here.
This will help us understand more about the environment in which the bug occurred.

Additional context
Unstructured Pod Config
Resources:
CPU: 4
Memory: 10000

Activity

  1. added
    bug
    on Jan 17, 2025
  2. Akashtyagi commented on Jan 17, 2025

    @Akashtyagi
    Author

    Similar Issue - #2129

  3. Akashtyagi commented on Jan 29, 2025

    @Akashtyagi
    Author

    Similar issue when tried to parse a 10mb rtf file. Utilising more than 10gb memory and crashing.

    @scanny / @badGarnet / @christinestraub Is this an expected behaviour or a bug ? Can anyone please comment on this.

  4. sticky-note commented on Feb 20, 2025

    @sticky-note

    Do someone have a workaround for this in container for example.
    Memory leak is intense !

  5. ImadSaddik commented on Feb 26, 2025

    @ImadSaddik

    We are facing the same issue.

  6. kholdrex commented on Oct 21, 2026

    @kholdrex
    Contributor

    The sheet becomes one Table with 9.6 MB of text_as_html. chunk_by_title splits it into 12,555 chunks, and each one serializes the whole table again in orig_elements, about 54 GB of JSON in total. include_orig_elements=False avoids it for now (24 MB). Fix: #4565.

  7. added a commit that references this issue on Oct 21, 2026
    cb82b55
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions