Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2014-04-15 15:17:12 +0000
committerDoug Schaefer2014-04-15 16:06:13 +0000
commitb12b65bfb8d95020d8138d1155006c8c2dc46a12 (patch)
tree65cee2d232154ae9f69814352590bef29e26c55c
parent995e0da76c2d84ebaea4f3797c855d6cb10d8969 (diff)
downloadorg.eclipse.cdt-b12b65bfb8d95020d8138d1155006c8c2dc46a12.tar.gz
org.eclipse.cdt-b12b65bfb8d95020d8138d1155006c8c2dc46a12.tar.xz
org.eclipse.cdt-b12b65bfb8d95020d8138d1155006c8c2dc46a12.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>
-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 bf438eb328b..7c04840cce7 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