Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 148779 Details for
Bug 245008
Workspace's ElementTree object holding 500MB in large workspace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch instrumenting AbstractDataTreeNode to find substring memory pigs
dataTreeSubstringInstrument.diff.txt (text/plain), 1.87 KB, created by
Martin Oberhuber
on 2009-10-05 10:18:00 EDT
(
hide
)
Description:
Patch instrumenting AbstractDataTreeNode to find substring memory pigs
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2009-10-05 10:18:00 EDT
Size:
1.87 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.resources >Index: src/org/eclipse/core/internal/dtree/AbstractDataTreeNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.resources/src/org/eclipse/core/internal/dtree/AbstractDataTreeNode.java,v >retrieving revision 1.22 >diff -u -r1.22 AbstractDataTreeNode.java >--- src/org/eclipse/core/internal/dtree/AbstractDataTreeNode.java 4 Apr 2006 20:53:47 -0000 1.22 >+++ src/org/eclipse/core/internal/dtree/AbstractDataTreeNode.java 5 Oct 2009 14:16:40 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.core.internal.dtree; > >+import java.lang.reflect.Field; >+ > import org.eclipse.core.internal.utils.Messages; > import org.eclipse.core.internal.utils.StringPool; > import org.eclipse.core.runtime.IPath; >@@ -43,6 +45,31 @@ > * children of the new node > */ > AbstractDataTreeNode(String name, AbstractDataTreeNode[] children) { >+ //find out whether the String to add is actually a substring. >+ //if yes, then add a part string into the pool. Using introspection. >+ if (name!=null) { >+ try { >+ Class c = String.class; >+ Field fldValue = c.getDeclaredField("value"); //$NON-NLS-1$ >+ fldValue.setAccessible(true); >+ Object o = fldValue.get(name); >+ if (o!=null) { >+ char[] value = (char[])o; >+ if (value.length != name.length()) { >+ name= new String(name); >+ } >+ } >+ } catch(NoSuchFieldException e) { >+ /*ignore*/ >+ e.printStackTrace(); >+ } catch(IllegalAccessException e) { >+ /*ignore*/ >+ e.printStackTrace(); >+ } catch(Throwable t) { >+ /*ignore*/ >+ t.printStackTrace(); >+ } >+ } > this.name = name; > if (children == null || children.length == 0) > this.children = AbstractDataTreeNode.NO_CHILDREN;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 245008
:
110723
|
110817
|
148334
|
148627
| 148779 |
150740
|
175560
|
175565
|
175704
|
175730
|
175795
|
175798