1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

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.
This commit is contained in:
Sergey Prigogin 2013-12-05 20:34:57 -08:00
parent fb08c843e9
commit 3fbe0d12af

View file

@ -1055,6 +1055,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;
}