diff options
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.java | 13 |
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 + } + } |