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

[C API] Memory leak #3438

Closed
rt21q8 opened this issue Dec 20, 2022 · 6 comments
Closed

[C API] Memory leak #3438

rt21q8 opened this issue Dec 20, 2022 · 6 comments
Assignees
Labels
📦 lib-c-api About wasmer-c-api memory-leak 🕵️ needs investigation The issue/PR needs further investigation priority-medium Medium priority issue 🏚 stale Inactive issues or PR

Comments

@rt21q8
Copy link

rt21q8 commented Dec 20, 2022

Describe the bug

When whole wasmer related cleanup calls are done, not whole memory is released. This scenario can be also observed on slightly modified example files contained in this repository. Details described below. Is this known/expected behavior?

$ echo "`wasmer -V` | `rustc -V` | `uname -m`"
wasmer 3.1.0 | rustc 1.63.0 (4b91a6ea7 2022-08-08) | x86_64

Steps to reproduce

  1. Go to lib/c-api/examples.
  2. Put all logic from main function into infinite while loop for example files like wasi.c or imports-exports.c or exports-function.c.
  3. Rebuild modified examples.
  4. Run new executables.
  5. Observe memory usage for started process in tool like top.

Expected behavior

Memory usage should not keep growing continuously (there is cleanup logic at the end of main/loop - are these all required calls?).

Actual behavior

Memory keeps growing.

Additional context

@syrusakbary syrusakbary added the 🕵️ needs investigation The issue/PR needs further investigation label Dec 27, 2022
@Michael-F-Bryan Michael-F-Bryan added the priority-medium Medium priority issue label Dec 27, 2022
@syrusakbary syrusakbary added memory-leak and removed priority-medium Medium priority issue labels Dec 27, 2022
@Michael-F-Bryan Michael-F-Bryan added 📦 lib-c-api About wasmer-c-api priority-medium Medium priority issue and removed memory-leak labels Dec 27, 2022
@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 30, 2023

I think this has been fixed now, on master, with latest Instance memory leak. Can you check again and see if you still see memory leak?

@rt21q8
Copy link
Author

rt21q8 commented Jan 30, 2023

It's still reproducible on both master branch and v3.1.1.

@ptitSeb
Copy link
Contributor

ptitSeb commented Jan 30, 2023

oh, ok. So it's another leak. Thanks for the testing, I'll investigate on this later.

@EclesioMeloJunior
Copy link

EclesioMeloJunior commented May 16, 2023

hello! @ptitSeb I would like to mention that I've posted this issue wasmerio/wasmer-go#393 on wasmer-go repository where I try to explain a memory leak I am facing that may be related to wasmer-c-api.

Copy link

stale bot commented May 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label May 16, 2024
Copy link

stale bot commented Jun 16, 2024

Feel free to reopen the issue if it has been closed by mistake.

@stale stale bot closed this as completed Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-c-api About wasmer-c-api memory-leak 🕵️ needs investigation The issue/PR needs further investigation priority-medium Medium priority issue 🏚 stale Inactive issues or PR
Projects
None yet
Development

No branches or pull requests

5 participants