summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-04-24 15:26:18 +0200
committerJon Bratseth <bratseth@oath.com>2018-04-24 15:26:18 +0200
commit06371345a7b7f7d27406bd8d72ca6769b7edb651 (patch)
tree4257b1f4b9f9891ce44bac60998029ebcf6b0e03 /container-search/src/main/java/com/yahoo/search/result/HitGroup.java
parent29d894be652512bf2e44ce57ac126a35fb1985e1 (diff)
Clear renderer hit groups
This allows us to stream more data than can fit in the container (across all concurrent queries), as rendered hits in completed groups can now be garbage collected. We can not deference the hit groups themselves as that entails modifying the parent list.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/result/HitGroup.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/result/HitGroup.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/result/HitGroup.java b/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
index cb3a9abffc4..8ad8e6a732f 100644
--- a/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
+++ b/container-search/src/main/java/com/yahoo/search/result/HitGroup.java
@@ -68,13 +68,13 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable<
transient private HitOrderer hitOrderer = null;
/** Accounting the number of subgroups to allow some early returns when the number is 0 */
- private int subgroupCount=0;
+ private int subgroupCount = 0;
/**
* The number of hits not cached at this level, not counting hits in subgroups or
* any nested hitgroups themselves
*/
- private int notCachedCount=0;
+ private int notCachedCount = 0;
/**
* A direct reference to the errors of this result, or null if there are no errors.
@@ -921,4 +921,13 @@ public class HitGroup extends Hit implements DataList<Hit>, Cloneable, Iterable<
hits.addListener(runnable);
}
+ @Override
+ public void close() {
+ super.close();
+ hits = null;
+ unmodifiableHits = null;
+ hitOrderer = null;
+ incomingHits.drain(); // Just to gc as much as possible
+ }
+
}