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

Styles with MBs worth of data: URIs use a ton of memory that's never reclaimed #59

Closed
JasonBarnabe opened this issue Aug 31, 2014 · 1 comment

Comments

@JasonBarnabe
Copy link
Contributor

Some speculation at http://stackoverflow.com/questions/20385767/finding-the-cause-of-a-memory-leak-in-ruby

@JasonBarnabe
Copy link
Contributor Author

It looks like the answer on StackOverflow was correct - it was creation of a whole lot of little strings that was causing the problem. The code to handle escape sequences was taking the URL, calling scan, map, and join on a character-by-character basis (even for non-escape sequences). I've modified it to use gsub only on escape sequences. The existing tests pass, and my pathological test posted on StackOverflow went from:

Memory 12404KB
Memory 292516KB

to

Memory 12236KB
Memory 19584KB

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

1 participant