Skip to main content
summaryrefslogtreecommitdiffstats
path: root/qt
diff options
context:
space:
mode:
authorDoug Schaefer2014-04-15 11:17:12 -0400
committerDoug Schaefer2014-04-15 12:06:40 -0400
commite907795125aa4c8b22d10d775a8a1b37de8fe531 (patch)
tree26a80dda9573fca8d2e54057172257f2e632791d /qt
parent84289fb45470cbb06576af54fba0e46a20837f6e (diff)
downloadorg.eclipse.cdt-e907795125aa4c8b22d10d775a8a1b37de8fe531.tar.gz
org.eclipse.cdt-e907795125aa4c8b22d10d775a8a1b37de8fe531.tar.xz
org.eclipse.cdt-e907795125aa4c8b22d10d775a8a1b37de8fe531.zip
Bug 432839 - Fix out of memory condition with Qt projects.
Turn the cache in QtPDOMLinkage into a WeahHashMap. Change-Id: I261d3aec5ee6b7537c4bfaa204dadd85b686140c Reviewed-on: https://git.eclipse.org/r/25064 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com> (cherry picked from commit b12b65bfb8d95020d8138d1155006c8c2dc46a12) Reviewed-on: https://git.eclipse.org/r/25069
Diffstat (limited to 'qt')
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java
index bf438eb328..7c04840cce 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMLinkage.java
@@ -10,8 +10,8 @@ package org.eclipse.cdt.internal.qt.core.pdom;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
+import java.util.WeakHashMap;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.ast.IASTName;
@@ -58,7 +58,7 @@ public class QtPDOMLinkage extends PDOMLinkage {
// The version that has been read from/written to the persisted file.
private int version;
- private final Map<IQtASTName, PDOMBinding> cache = new HashMap<IQtASTName, PDOMBinding>();
+ private final Map<IQtASTName, PDOMBinding> cache = new WeakHashMap<IQtASTName, PDOMBinding>();
public QtPDOMLinkage(PDOM pdom, long record) throws CoreException {
super(pdom, record);
@@ -166,6 +166,9 @@ public class QtPDOMLinkage extends PDOMLinkage {
//
// I don't think this needs to be thread-safe, because things are only added from
// the single indexer task.
+ //
+ // Doug: The cache is causing out of memory conditions. Commenting out for now.
+ //
PDOMBinding pdomBinding = null;
pdomBinding = cache.get(qtAstName);
if (pdomBinding != null)

Back to the top