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

Removed @parsed_configs and storing if parsed in object. Fixed leak! #48

Closed
wants to merge 1 commit into from

Conversation

eljojo
Copy link

@eljojo eljojo commented Nov 30, 2013

We were storing whether an object had been parsed or not in
@parsed_configs, inside SAXHandler, which was a huge memory leak in case
we wanted to parse really big files.

Created an instance variable in each element to store whether the
element_config was parsed already or not.

It feels a little bit dirty, but it's much better for garbage collection :)

Tests are passing.

We were storing whether an object had been parsed or not in
@parsed_configs, inside SAXHandler, which was a huge memory leak in case
we wanted to parse really big files.

Created an instance variable in each element to store whether the
element_config was parsed already or not.

It feels a little bit dirty, but it's much better for garbage collection :)

Tests are passing.
@krasnoukhov
Copy link
Collaborator

Hey @eljojo, thank you for the PR.

I'm afraid that this does not make sense since sax-machine does not support such thing as streaming. So basically it can not be garbage collected until nothing references top-level document object.

In fact, sax-machine needs a lot way more refactoring to do in order to support really large files, please see my comment here.

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.

None yet

2 participants