Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-12-05 23:34:57 -0500
committerSergey Prigogin2013-12-06 15:30:08 -0500
commitd144de5c1d527ab402fcc38f915790df8b582ec3 (patch)
treedfe4cb0a9970421b84eed1b0d5f8fe0c77fab801
parentbccbb89f68aa51658fd165c8cd993d388c135b61 (diff)
downloadorg.eclipse.cdt-d144de5c1d527ab402fcc38f915790df8b582ec3.tar.gz
org.eclipse.cdt-d144de5c1d527ab402fcc38f915790df8b582ec3.tar.xz
org.eclipse.cdt-d144de5c1d527ab402fcc38f915790df8b582ec3.zip
Bug 400073 - Indexer runs out of memory.
Fixed a soft memory leak caused by accumulation of data in PDOM.fResultCache when several consecutive files fail to parse.
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
index 9150a63b97..d9553b3c75 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
@@ -1044,6 +1044,14 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
}
if (th != null) {
swallowError(path, th);
+ // In case of a parsing error the result cache may not have been cleared.
+ // Clear if under a write lock to reduce interference with index readers.
+ fIndex.acquireWriteLock();
+ try {
+ fIndex.clearResultCache();
+ } finally {
+ fIndex.releaseWriteLock();
+ }
}
return null;
}

Back to the top