diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java index 103560466ea5..b60b58736eb3 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java @@ -261,7 +261,8 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel, StringInterner interner = new StringInterner(); for (final Object o : element.getChildren(INSPECTION_TOOL_TAG)) { - Element toolElement = (Element)o; + // make clone to avoid retaining memory via o.parent pointers + Element toolElement = (Element)((Element)o).clone(); JDOMUtil.internElement(toolElement, interner); String toolClassName = toolElement.getAttributeValue(CLASS_TAG);