High memory consumption #54

Closed
psienko opened this Issue Aug 30, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@psienko

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

This comment has been minimized.

Show comment
Hide comment
@philr

philr Oct 3, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@philr

philr Mar 25, 2017

Member

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

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