mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32: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:
parent
fb08c843e9
commit
3fbe0d12af
1 changed files with 8 additions and 0 deletions
|
@ -1055,6 +1055,14 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
|
||||||
}
|
}
|
||||||
if (th != null) {
|
if (th != null) {
|
||||||
swallowError(path, th);
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue