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

Az482 fix intersection mem leak #66

Merged
merged 1 commit into from Jul 1, 2011

Conversation

rzezeski
Copy link
Contributor

az482

In the select_fun for the intersection_op (i.e. AND) it would stop
once one of it's iterators had been exhausted but would leave the
other one as is, messages and all. So in the case where one side is
empty and other side has a bunch of results (or this query is run a
lot, memory usage = result size * # of queries) the results just sit
on a process that waits indefinitely for something to pull the results
off it's mailbox. The reason this doesn't occur if you use a PB conn
for each transaction is because he PB conn is the parent of these
processes and they are all linked. If it dies they all die.

The solution is to make sure all iterators are exhausted.

az482

In the select_fun for the intersection_op (i.e. AND) it would stop
once one of it's iterators had been exhausted but would leave the
other one as is, messages and all. So in the case where one side is
empty and other side has a bunch of results (or this query is run a
lot, memory usage = result size * # of queries) the results just sit
on a process that waits indefinitely for something to pull the results
off it's mailbox.  The reason this doesn't occur if you use a PB conn
for each transaction is because he PB conn is the parent of these
processes and they are all linked.  If it dies they all die.

The solution is to make sure all iterators are exhausted.
@rustyio
Copy link
Contributor

rustyio commented Jul 1, 2011

Looks good. Verified using https://github.com/gordyt/riaksearch-test.

rzezeski added a commit that referenced this pull request Jul 1, 2011
@rzezeski rzezeski merged commit 7036e82 into riak_search-0.14 Jul 1, 2011
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