Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when using mupdf-rs: #90

Open
RikaKit opened this issue May 28, 2024 · 2 comments
Open

Memory leak when using mupdf-rs: #90

RikaKit opened this issue May 28, 2024 · 2 comments

Comments

@RikaKit
Copy link
Contributor

RikaKit commented May 28, 2024

After completing the work of extracting the image from the document
mupdf should free up used memory,
but mupdf does not release the used memory,
With each image extracted, memory consumption increases.

Here is a demo code to reproduce the problem:
test_mupdf_memory_leak.rs.txt

@itsjunetime
Copy link
Collaborator

I also noticed what I think is an instance of a memory leak in this library, specifically here in src/page.rs. It looks like the FFI layer transfers ownership of a slice to the rust layer, but the rust layer just reads it then copies it over elsewhere (thus leaving the slice leaked).

I think that #108 could help with this, and I'd be happy to help tackle these leaks once that is settled.

@messense
Copy link
Owner

Pull requests are welcome!

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

No branches or pull requests

3 participants