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

Multipart processing existence of memory leakage #903

Open
fish-jade opened this issue Sep 27, 2024 · 4 comments
Open

Multipart processing existence of memory leakage #903

fish-jade opened this issue Sep 27, 2024 · 4 comments
Labels
discussion The viability / implementation of the issue is up for debate

Comments

@fish-jade
Copy link

fish-jade commented Sep 27, 2024

demo:https://github.com/fish-jade/crow-demo/tree/demo-cpp

Core upload code
image

When using crow::multipart::message to upload a file of about 88 MB, no processing will be done, and eventually there will be a memory leak.
Memory before upload:

image

Uploaded memory:
image

Use postman to upload debugging, as shown in the figure:
image

Please help check if it is a usage problem or a leak bug of crow itself, thank you very much~ ❤️❤️

@fish-jade
Copy link
Author

No matter how long memory is never released, and there will be further memory increases after repeated requests for uploads.

@gittiver gittiver added the discussion The viability / implementation of the issue is up for debate label Sep 29, 2024
@fish-jade
Copy link
Author

Hello @gittiver , may I ask if you can preliminarily determine whether it is a bug or a use problem? And what can I do to move this issue forward faster?

@gittiver
Copy link
Member

gittiver commented Oct 8, 2024

You could show that it is not a usage problem.
A second idea - have you checked that a complete request arrives at crow server - maybe a timeout happens?
if crow consumes memory, what arrives?

@fish-jade
Copy link
Author

fish-jade commented Oct 10, 2024

Thank you very much for your reply! @gittiver

I provided a minimal demo: https://github.com/fish-jade/crow-demo/tree/demo-cpp. At the moment I don't think it's a usage issue. As for the second idea, the request can reach the crow server normally and eventually return 200, but the handler in the crow server does not actually have any code with memory leaks (there is a core code map in my question).

I also compared other libraries such as cpp-httplib, rocket in rust, these two will also have memory growth but compared to crow will be less about 2-3M, crow memory growth on the first request will be more about 17M, subsequent multiple requests will grow by 2-3M.

I'm not sure if this is normal, other libraries also have memory growth and don't release it (but crow grows more than others).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion The viability / implementation of the issue is up for debate
Projects
None yet
Development

No branches or pull requests

2 participants