Community
Participate
Working Groups
Build: 1.5.0 Whenever you remove a node from the WSExplorer's naviagtor view. It is only removed visually, the underlying model hangs around in memory. To reporduce: Profile WTP with some profile tool (I used YourKit). Start up the WSExplorer, load a WSDL into the WSDL perspective. Remove the WSDL. Get a memory snapshot, you should see that the WSDL nodes/model are still in memory. For example, here's the GC stack for the WSDLOperationNode org.eclipse.wst.ws.internal.explorer.platform.wsdl.perspective.WSDLOperationNode [0] of java.lang.Object[11] elementData of java.util.Vector fListeners of org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLOperationElement value of java.util.Hashtable$Entry [2] of java.util.Hashtable$Entry[23] table of java.util.Hashtable fElements of org.eclipse.wst.ws.internal.datamodel.BasicModel model_ of org.eclipse.wst.ws.internal.explorer.platform.wsdl.perspective.WSDLPerspective currentPerspective_ of org.eclipse.wst.ws.internal.explorer.platform.perspective.Controller value of java.util.HashMap$Entry [7] of java.util.HashMap$Entry[17] table of java.util.HashMap attributes of org.apache.catalina.session.StandardSession value of java.util.HashMap$Entry [61] of java.util.HashMap$Entry[65] table of java.util.HashMap sessions of org.apache.catalina.session.StandardManager [Stack Local]
Btw, the impact is pretty significant because this leaks the entire WSDL/XSD model.
Gil, please investigate. Thanks - CB. Jeff, I don't have a good feel for how broad the issue is, or how simple a matter it is to remove the referenced models (assuming it has no state that needs to be kept, or other visual artifacts still referring to it). Is this problem specific to certain types of nodes, or to all of them? Targetted to WTP 1.5.1 for now, but if the problem becomes complex, I'll defer it.
This problem applies to all nodes (UDDI, WSIL, WSDL and Favorites). My guess is the node/model framework that these nodes use is not properly disconnecting the nodes when they were removed. As I recall, when a node is removed, its reference model is no longer needed. Meaning there shouldn't be anything else that refers to it.
Ok Ive looked at this issue but havent made any changes as I wouldnt mind having suggestions about why the thing was designed this way and how we might handle this situation elegantly. I looked specifically at the wsdl perspective for starters. I am assuming the other perspectives follow the same pattern. The problem is that the different parts of the model are not related. For instance the WSDL Model has 5 main different parts. The WSDLMainNode, WSDLNode, WSDLServiceNode, WSDLBindingNode, WSDLOperationNode. So you would think that the WSDLServiceNode is the child of WSDLNode. This is not the case. Also you would think WSDLBindingNode is a child of WSDLServiceNode this is not the case. In actual fact they are added directly to the WSDLMainNode. So when the WSDLNode is cleared from the navigator view it is being cleared properly and is being removed from the model. However since the WSDLServiceNode that was created by this wsdl is not under the WSDLNode it remains in the model along with the other aforementioned nodes. Upon deletion I cant just clear out the model as I might be killing services,bindings and operations from other wsdls. So the solution is to other link these up so that when I delete one they all get deleted which the model is designed to do. Unfortunately this is going to be a bigger and riskier change then anticipated. Or we could possibly create a table that keeps track of it which is less of a change but isnt that great looking. I guess there might also be a way to find something that all these nodes have in common like maybe i can grab the internal model object and find out what wsdl it belonged. Not really a fan of that either.
The proper solution here is to hook up the parent-child relationship properly (instead of having all WSDL nodes hanging off the WSDL Main Node).
Jeff, thanks for taking this one.
There were 2 problems: 1. Model elements were not being removed from the model 2. Nodes where not being removed from the node manager I have a fix, I'll submit a patch.
Created attachment 48389 [details] Patch for wst.ws.explorer
Created attachment 48391 [details] New patch for wst.ws.explorer
Fix committed into HEAD. Kathy/Peter, can you do the release? Thanks.
This patch has been released under version v200608222020.
Verified.
close.