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

Fix memory leak in in history collection #43

Merged
merged 1 commit into from
Jan 5, 2015
Merged

Fix memory leak in in history collection #43

merged 1 commit into from
Jan 5, 2015

Conversation

jbowes
Copy link
Contributor

@jbowes jbowes commented Jan 4, 2015

History is stored as a list of logger records. After determining the
history for a given record, that history was then added to the record.
This led to a tree of records. Even though the history in the logger was
truncated, active records in the history would continue to point to
inactive ones, and so on, causing a memory leak.

Since the history field on record objects was only used within the
_add_history method, convert it to a local variable, and kill the leak.

History is stored as a list of logger records. After determining the
history for a given record, that history was then added to the record.
This led to a tree of records. Even though the history in the logger was
truncated, active records in the history would continue to point to
inactive ones, and so on, causing a memory leak.

Since the history field on record objects was only used within the
_add_history method, convert it to a local variable, and kill the leak.
@brianr
Copy link
Member

brianr commented Jan 4, 2015

Thanks @jbowes! This looks good to me.

@coryvirok can you think of any reason why we were storing the history inside the record object?

@coryvirok
Copy link
Contributor

@brianr I cannot. I was surprised to read that code and see record.history used instead of a local.

brianr added a commit that referenced this pull request Jan 5, 2015
Fix memory leak in in history collection
@brianr brianr merged commit 6696604 into rollbar:master Jan 5, 2015
@brianr
Copy link
Member

brianr commented Jan 5, 2015

Released in 0.9.6. Thanks again!

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 this pull request may close these issues.

3 participants