Bug 236628 [Viewers] [JFace] Excessive Memory Usage by Project Explorer because of styles
Build ID: I20080516-1333 Steps To Reproduce: Project Explorer creates duplicate identical strings for every entry in it and wastes few Megabytes of memory depending on the scenario. In the update method of NavigatorDecoratingLabelProvider extending DelegatingStyledCellLabelProvider the call to cell.setStyleRanges(newStyleRanges) results in duplicate strings for the same column. The duplicate strings are created in ViewerRow.setStyleRanges public void setStyleRanges(int columnIndex, StyleRange[] styleRanges) { getItem().setData(KEY_TEXT_LAYOUT + columnIndex, styleRanges); } More information:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerRow.java
/**
	 * Translate the original column index to the actual one.
	 * <p>
	 * <b>Because of backwards API compatibility the default implementation
	 * returns the original index. Implementators of {@link ColumnViewer} should
	 * overwrite this method if their widget supports reordered columns</b>
	 * </p>
	 * 
	 * @param creationIndex
	 *            the original index
	 * @return the current index (as shown in the UI)
	 * @since 3.4
	 */
	protected int getVisualIndex(int creationIndex) {
		return creationIndex;
	}
	/**
	 * Translate the current column index (as shown in the UI) to the original
	 * one.
	 * <p>
	 * <b>Because of backwards API compatibility the default implementation
	 * returns the original index. Implementators of {@link ColumnViewer} should
	 * overwrite this method if their widget supports reordered columns</b>
	 * </p>
	 * 
	 * @param visualIndex
	 *            the current index (as shown in the UI)
	 * @return the original index
	 * @since 3.4
	 */