Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2018-04-17 13:10:19 +0000
committerKarsten Thoms2018-04-17 13:10:19 +0000
commit34db1f81770632c6289bb024c2ab4d7284456a95 (patch)
tree14c7e6c9b6b120a7b8fc21e4e54dfdc94a1832f3
parenta42dd798672ddf63a522143008dd5e1435849c08 (diff)
downloadeclipse.platform.text-34db1f81770632c6289bb024c2ab4d7284456a95.tar.gz
eclipse.platform.text-34db1f81770632c6289bb024c2ab4d7284456a95.tar.xz
eclipse.platform.text-34db1f81770632c6289bb024c2ab4d7284456a95.zip
Bug 514961 - Free resources allocated by TextSearchJob
The fields fileCharSequenceProvider, previousLocationFromFile, occurencesForPreviousLocation & charsequenceForPreviousLocation are allocated during the run method and are not used after job execution. Especially charsequenceForPreviousLocation is problematic and can result in an OOME on large search scope. Change-Id: Ic7992778263afa5910fabf1ca56077ab5b072884 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
index b798c00aa8e..a3438695c56 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
@@ -193,8 +193,13 @@ public class TextSearchVisitor {
fileCharSequenceProvider.releaseCharSequence(charsequenceForPreviousLocation);
} catch (IOException e) {
SearchPlugin.log(e);
+ } finally {
+ charsequenceForPreviousLocation = null;
}
}
+ fileCharSequenceProvider = null;
+ previousLocationFromFile = null;
+ occurencesForPreviousLocation = null;
return multiStatus;
}

Back to the top