FYI Rob Stryker (our JBossAS adapter lead) has found a memory leak in the DroolsIDE code:<br><br><div><span class="gmail_quote">On 8/14/06, <b class="gmail_sendername">Robert Stryker</b> &lt;<a href="mailto:rob.stryker@jboss.com">
rob.stryker@jboss.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hey Marshall:<br><br>&nbsp; Please forward this over to the rules guy. I found a memory leak in his code. 
<br><br>The class RuleHelperActionDelegate (<a href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-ide/src/main/java/org/drools/ide/menu/RuleHelperActionDelegate.java" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

svn</a>)&nbsp; has a memory leak. Specifically:<br><br>the Delegate itself is responsible for deleting any and all created Menu widgets. In the current implementation, the getMenu(Control) method is as follows:<br><br><pre>       Menu menu = new Menu( parent );
<br><br>        final Shell shell = parent.getShell();<br>        addProjectWizard( menu, shell );<br>        addRuleWizard( menu,shell );<br>        addDSLWizard( menu, shell );<br>        addDTWizard( menu,shell );        
<br>
        return menu;</pre><br>Clearly, new menu widgets are created each time and are never disposed of. A correct implementation of this interface is available at org.eclipse.wst.server.ui.internal.webbrowser.SwitchBrowserWorkbenchAction

. Specifically, the getMenu(Control) method should first dispose of the last menu, then create the new ones. <br><br>&nbsp;&nbsp;&nbsp; public Menu getMenu(Control parent) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; setMenu(new Menu(parent));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //fillMenu(fMenu);
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; initMenu();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return fMenu;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; private void setMenu(Menu menu) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (fMenu != null) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fMenu.dispose();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fMenu = menu;<br>&nbsp;&nbsp;&nbsp; }<br><br>

<br>So... ... ... he needs to destroy his menus before creating new ones =] <br>

</div></blockquote></div><br><br clear="all"><br>-- <br>Marshall Culpepper<br><a href="mailto:marshall.culpepper@jboss.com">marshall.culpepper@jboss.com</a><br>JBoss Eclipse IDE Lead, JBoss Inc.