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

High memory consumption #54

Closed
psienko opened this issue Aug 30, 2016 · 2 comments · Fixed by #57
Closed

High memory consumption #54

psienko opened this issue Aug 30, 2016 · 2 comments · Fixed by #57

Comments

@psienko
Copy link

psienko commented Aug 30, 2016

I have noticed that the tzinfo gem generate many string objects.

Links to problematic lines:

Maybe good idea will be using freezing strings (e.g. 'NN'.freeze) or storing strings as constants.

Below are memory profiling results for one of request in my application

Results before freezing strings:
allocated memory by gem [bytes] allocated objects by gem allocated memory by class [bytes] allocated objects by class
5519372 tzinfo-1.2.2 181142 tzinfo-1.2.2 29220995 String 324131 String
Results after freezing strings:
allocated memory by gem [bytes] allocated objects by gem allocated memory by class [bytes] allocated objects by class
32160 tzinfo-1.2.2 1044 tzinfo-1.2.2 27375064 String 263417 String
@philr
Copy link
Member

philr commented Oct 3, 2016

Thank you for reporting this. A change to freeze the strings you have identified has been merged as part of #57.

@philr
Copy link
Member

philr commented Mar 25, 2017

The fix for this issue has now been released in version 1.2.3.

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

Successfully merging a pull request may close this issue.

2 participants