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

Use of to_sym can cause memory leaks #33

Closed
mockaroo opened this issue Dec 3, 2014 · 2 comments
Closed

Use of to_sym can cause memory leaks #33

mockaroo opened this issue Dec 3, 2014 · 2 comments

Comments

@mockaroo
Copy link
Contributor

mockaroo commented Dec 3, 2014

I noticed that string keys in the variables hash are converted to symbols prior to calculation. This can lead to memory leaks over time when the set of possible variable names is infinite (for example, when end users can create their own variables), as Ruby never garbage collects symbols. Is it possible to leave keys as strings to prevent this? A quick search of the codebase for "to_sym" will show a few places where this is problematic.

@rubysolo
Copy link
Owner

rubysolo commented Dec 3, 2014

Seems reasonable. I can take a look at that next time I have a chance, or I would consider a PR. 😄

@rubysolo
Copy link
Owner

Fixed in 0e1be5c

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

2 participants