Skip to content

Memory leak #2566

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

Closed
imaximix opened this issue May 20, 2025 · 5 comments · Fixed by #2567
Closed

Memory leak #2566

imaximix opened this issue May 20, 2025 · 5 comments · Fixed by #2567

Comments

@imaximix
Copy link

Hello,

We have a rather large-ish and old application running grape.
We recently upgraded from 2.0 to 2.2 and noticed our RAM usage going bonkers.
The issue got tracked down to this commit

Here is a repro

@ericproulx
Copy link
Contributor

I do confirm the memory leak. Nice catch.

@ericproulx
Copy link
Contributor

@imaximix there's something odd by calling API.recognize_path in the route :any, '*path'. If you comment the whole route :any, '*path' it won't leak. Most of API.recognize_path are done outside of the Grape::API classes.

@imaximix
Copy link
Author

imaximix commented May 20, 2025

Yea, that is the trigger.

In our real app, we use it to set 404 or 405.

if recognize_path
 405
else
 404
end

@ericproulx
Copy link
Contributor

@imaximix could you give a try to #2567 ?

@imaximix
Copy link
Author

@ericproulx works great! Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants