Skip to content

Encountering a memory leak when call PyDocX.to_html? #260

@sunglowrise

Description

@sunglowrise

Hi!
Encountering a memory leak when call PyDocX.to_html, is not the right way to use it ?

test example:

# python3.6 
# PyDocX == 0.9.10
def test_to_html():
    tracemalloc.start()
    snapshot1 = tracemalloc.take_snapshot()

    for i in range(10):
        with open("/tmp/test.docx", "rb") as f:
            html = PyDocX.to_html(f)
            print(html)

    snapshot2 = tracemalloc.take_snapshot()
    top_stats = snapshot2.compare_to(snapshot1, "lineno")
    for stat in top_stats:
        print(stat)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions