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> <<a href="mailto:rob.stryker@jboss.com">
rob.stryker@jboss.com</a>> 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> 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>) 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> public Menu getMenu(Control parent) {<br> setMenu(new Menu(parent));<br> //fillMenu(fMenu);
<br> initMenu();<br> return fMenu;<br> }<br><br> private void setMenu(Menu menu) {<br> if (fMenu != null) {<br> fMenu.dispose();<br> }<br> fMenu = menu;<br> }<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.