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 memleak for long-lived resultsets. #29

Closed
wants to merge 1 commit into from

Conversation

vovkasm
Copy link

@vovkasm vovkasm commented Jul 10, 2013

It is a recursive attributes hash chain when call search on the same
resultset many times. It looks like pseudo-leak with long-lived resultsets.

In our application (that long-lived daemon) we use something like this:

sub periodic_refresh {
  state $rs = $schema->resultset('ServerBackend')->search({status=>'active'},{order_by=>'me.id',prefetch=>'Server'});
  my @fresh_backends = $rs->all; # now we use this workaround: $rs->search; but it is slower because new resultset created on every iteration
  # other refresh logic
}

This patch fix a problem.
I'm just not sure of a good name for the test file. Now it is 110leaktrace.t, but it can be renamed to something more appropriate.

It is a recursive attributes hash chain when call search on the same
resultset many times.
@ribasushi
Copy link
Collaborator

Saw it, bug is real. Will be looked at later today (I believe there are more issues of this nature)

@ribasushi
Copy link
Collaborator

This finally landed in master as 6ae62c5c1, though with a both different test and different solution. Apologies for the delay, the tooling needed to be improved before asserting this is indeed the end of the issue.

Cheers!

@ribasushi ribasushi closed this Jan 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants