<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
pre
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-GB link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Awesome, thank you – we’ll get
a JIRA made for that today.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
marshall.jboss@gmail.com [mailto:marshall.jboss@gmail.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Marshall Culpepper<br>
<b><span style='font-weight:bold'>Sent:</span></b> 15 August 2006 01:42<br>
<b><span style='font-weight:bold'>To:</span></b> jbosside-dev@lists.jboss.org;
Kris Verlaenen; Mark Proctor; Michael Neale<br>
<b><span style='font-weight:bold'>Subject:</span></b> FW: Memory leak in
DroolsIDE</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>FYI Rob Stryker (our
JBossAS adapter lead) has found a memory leak in the DroolsIDE code:<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>On 8/14/06, <b><span style='font-weight:bold'>Robert
Stryker</span></b> <<a href="mailto:rob.stryker@jboss.com">
rob.stryker@jboss.com</a>> wrote:</span></font></span><o:p></o:p></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>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"> 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:<o:p></o:p></span></font></p>
<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'> Menu menu = new Menu( parent );<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><br>
<br>
final Shell shell = parent.getShell();<br>
addProjectWizard( menu, shell );<br>
addRuleWizard( menu,shell );<br>
addDSLWizard( menu, shell );<br>
addDTWizard( menu,shell ); <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><br>
<br>
<o:p></o:p></span></font></pre><pre><font size=2 face="Courier New"><span
style='font-size:10.0pt'> return menu;<o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><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 =] <o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><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. <o:p></o:p></span></font></p>
</div>
</body>
</html>