зеркало из https://github.com/mozilla/gecko-dev.git
775 строки
7.5 KiB
HTML
775 строки
7.5 KiB
HTML
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<meta name="Author" content="Suresh Duddi">
|
|
<meta name="GENERATOR" content="Mozilla/4.61 [en] (WinNT; U) [Netscape]">
|
|
<title>Memory leaks fixing</title>
|
|
</head>
|
|
<body>
|
|
|
|
<center>
|
|
<h1>
|
|
Memory leaks fixing effort
|
|
<hr WIDTH="100%"></h1></center>
|
|
|
|
<h2>
|
|
Viewer</h2>
|
|
|
|
<ul>
|
|
<li>
|
|
Startup (not the firsttime)</li>
|
|
|
|
<li>
|
|
Show default page</li>
|
|
|
|
<li>
|
|
Quit</li>
|
|
</ul>
|
|
|
|
<table BORDER COLS=3 WIDTH="100%" >
|
|
<tr>
|
|
<th>Component</th>
|
|
|
|
<th>Leaks fixing by...</th>
|
|
|
|
<th>Status (<a href="#Stage 1: nsIModule conversion">nsIModule conversion</a>)</th>
|
|
</tr>
|
|
|
|
<tr BGCOLOR="#FFFF99">
|
|
<td COLSPAN="3"><b>bin/Components/</b></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>caps.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>chardet.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>history.dll</td>
|
|
|
|
<td>dp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>jsloader.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>lwbrk.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko_resource.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko_file.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nsgif.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nslocale.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mimetype.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>oji.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>profile.dll</td>
|
|
|
|
<td>dp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorhtml.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorview.dll</td>
|
|
|
|
<td>dp</td>
|
|
|
|
<td>DONE (doesnt cache factory)</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rdf.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>uconv.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucvlatin.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucharuti.dll</td>
|
|
|
|
<td>ftang</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>xpc3250.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>xppref32.dll</td>
|
|
|
|
<td>dp</td>
|
|
|
|
<td>DONE </td>
|
|
</tr>
|
|
|
|
<tr BGCOLOR="#FFFF99">
|
|
<td COLSPAN="3"><b>bin/</b></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>jsdom.dll</td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorhtmlpars.dll</td>
|
|
|
|
<td>vidur</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorgfxwin.dll</td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorweb.dll</td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorplugin.dll</td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>raptorwidget.dll</td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2>
|
|
Apprunner only</h2>
|
|
|
|
<table BORDER COLS=3 WIDTH="100%" >
|
|
<tr>
|
|
<th>Component</th>
|
|
|
|
<th>Leaks fixing by...</th>
|
|
|
|
<th>Status (<a href="#Stage 1: nsIModule conversion">nsIModule conversion</a>)</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>addrbook.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>bookmarks.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>brprof.dll</td>
|
|
|
|
<td>XXX</td>
|
|
|
|
<td>rjc says: This should be removed from build. See bug # 13732</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>chrome.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>cnvts.dll</td>
|
|
|
|
<td>morse</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>cookie.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>directory.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>emitter.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ender.dll</td>
|
|
|
|
<td>morse</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>eventloop.dll</td>
|
|
|
|
<td>XXX - Don't do this</td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>intlcmpt.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>jar50.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>jsurl.dll</td>
|
|
|
|
<td>morse</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mime.dll</td>
|
|
|
|
<td>mscott</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mork.dll</td>
|
|
|
|
<td>bienvenu</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mozbrwsr.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mozfind.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mozucth.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>mozxfer.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>msgbase.dll</td>
|
|
|
|
<td>putterman</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>msgcompo.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>msgdb.dll</td>
|
|
|
|
<td>bienvenu</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>msgimap.dll</td>
|
|
|
|
<td>mscott</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>msglocal.dll</td>
|
|
|
|
<td>mscott</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>msgnews.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nativeapp.dll</td>
|
|
|
|
<td>XXX - Don't do this</td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko_about.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko_data.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko_ftp.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>necko_http.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nsjpg.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nspng.dll</td>
|
|
|
|
<td>kipp</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nsprefm.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>nsxpi.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>pics.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>prefwind.dll</td>
|
|
|
|
<td>alecf</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rdfdomds.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>regviewer.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>related.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>sample.dll</td>
|
|
|
|
<td>-sample- Don't do this one.</td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>search.dll</td>
|
|
|
|
<td>rjc</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>stremcnv.dll</td>
|
|
|
|
<td>morse</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>strres.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>txmgr.dll</td>
|
|
|
|
<td>morse</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>txtsvc.dll</td>
|
|
|
|
<td>morse</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucvcn.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucvja.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucvko.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucvtw.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>ucvtw2.dll</td>
|
|
|
|
<td>cata</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>vcard.dll</td>
|
|
|
|
<td>XXX - Don't do this</td>
|
|
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>wallet.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>wlltvwrs.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>xpctest.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>xpiflash.dll</td>
|
|
|
|
<td>neeti</td>
|
|
|
|
<td>DONE</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<h2>
|
|
How to fix leaks in a dll</h2>
|
|
|
|
<h3>
|
|
<a NAME="Stage 1: nsIModule conversion"></a>Stage 1: nsIModule conversion</h3>
|
|
|
|
<ol>
|
|
<li>
|
|
Convert dll to use nsIModule. Sample code is in <a href="http://lxr.mozilla.org/seamonkey/source/xpcom/sample/nsSampleModule.cpp">mozilla/xpcom/sample/nsSampleModule.cpp</a>.
|
|
Things to watch out for:</li>
|
|
|
|
<ol>
|
|
<li>
|
|
nsIModule::UnregisterSelf should not return an Error.</li>
|
|
|
|
<li>
|
|
Cache factories created by modules in the module.</li>
|
|
</ol>
|
|
The sample code does all this right. So sticking to closely is adviced.</ol>
|
|
|
|
<h3>
|
|
<a NAME="Stage 2: Leak fixing"></a>Stage 2: Leak fixing <font color="#CC0000">(DONT
|
|
DO THIS NOW)</font></h3>
|
|
|
|
<ol>
|
|
<li>
|
|
While in purify run <a href="http://lxr.mozilla.org/seamonkey/source/xpcom/tests/TestShutdown.cpp">bin/TestShutdown</a>
|
|
on the dll. For this you will need to find a CID that the module implements.
|
|
Then invoke TestShutdown as</li>
|
|
|
|
<ol>TestShutdown {123d4-4908-490840-409850}</ol>
|
|
|
|
<li>
|
|
Make sure there are no leaks from the purify output.</li>
|
|
|
|
<br>Use ns<dll>Module::Shutdown() to release any global memory that
|
|
is being leaked.</ol>
|
|
|
|
<hr WIDTH="100%">
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
</body>
|
|
</html>
|