View | Details | Raw Unified | Return to bug 292267 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/localstore/UnifiedTreeNode.java (+12 lines)
Lines 7-12 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Martin Oberhuber (Wind River) - [292267] OutOfMemoryError due to leak in UnifiedTree
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.core.internal.localstore;
12
package org.eclipse.core.internal.localstore;
12
13
Lines 108-113 Link Here
108
		this.fileInfo = info;
109
		this.fileInfo = info;
109
		this.existsWorkspace = existsInWorkspace;
110
		this.existsWorkspace = existsInWorkspace;
110
	}
111
	}
112
	
113
	/**
114
	 * Releases elements that won't be needed any more for garbage collection.
115
	 * Should be called before adding a node to the free list.
116
	 */
117
	public void releaseForGc() {
118
		this.child = null;
119
		this.resource = null;
120
		this.store = null;
121
		this.fileInfo = null;
122
	}
111
123
112
	public void setExistsWorkspace(boolean exists) {
124
	public void setExistsWorkspace(boolean exists) {
113
		this.existsWorkspace = exists;
125
		this.existsWorkspace = exists;
(-)src/org/eclipse/core/internal/localstore/UnifiedTree.java (-2 / +7 lines)
Lines 9-14 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Martin Oberhuber (Wind River) - [105554] handle cyclic symbolic links
10
 *     Martin Oberhuber (Wind River) - [105554] handle cyclic symbolic links
11
 *     Martin Oberhuber (Wind River) - [232426] shared prefix histories for symlinks
11
 *     Martin Oberhuber (Wind River) - [232426] shared prefix histories for symlinks
12
 *     Martin Oberhuber (Wind River) - [292267] OutOfMemoryError due to leak in UnifiedTree
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.core.internal.localstore;
14
package org.eclipse.core.internal.localstore;
14
15
Lines 107-114 Link Here
107
				addNodeChildrenToQueue(node);
108
				addNodeChildrenToQueue(node);
108
			else
109
			else
109
				removeNodeChildrenFromQueue(node);
110
				removeNodeChildrenFromQueue(node);
110
			//allow reuse of the node
111
			//allow reuse of the node, but don't let the freeNodes list grow infinitely
111
			freeNodes.add(node);
112
			if (freeNodes.size() < 32767) {
113
				freeNodes.add(node);
114
				//free memory-consuming elements of the node for garbage collection
115
				node.releaseForGc();
116
			}
112
		}
117
		}
113
	}
118
	}
114
119

Return to bug 292267