MailNews:Memory Bloat and Leak Tests: Difference between revisions

Jump to navigation Jump to search
note that page has moved to MDC
(note that page has moved to MDC)
Line 1: Line 1:
<small>[[MailNews:Performance Testing|<< Back to MailNews:Performance Testing]]</small>
<small>[[MailNews:Performance Testing|&lt;&lt; Back to MailNews:Performance Testing]]</small>  


__TOC__
'''NOTE: This page (and its related talk page) has been moved to the [https://developer.mozilla.org/Talk:en/MailNews/Leak_And_Bloat_Tests Mozilla Developer Center]. Please refer to that page for recent updates and discussions.'''


''Note: MailNews here refers to either Thunderbird, or the Mail/Newsgroups/Address Book part of SeaMonkey''
__TOC__


== Aim ==
''Note: MailNews here refers to either Thunderbird, or the Mail/Newsgroups/Address Book part of SeaMonkey''


* To provide a continuous check within Mailnews and its sub-components for the following items:
== Aim  ==
*# Total memory leaks.
*# Total memory usage (aka bloat).
* Provide a consistent number from build to build where no source code has changed.
* Provide reasonable coverage for the normal activities that a user performs.


== Method ==
*To provide a continuous check within Mailnews and its sub-components for the following items:
*#Total memory leaks.
*#Total memory usage (aka bloat).
*Provide a consistent number from build to build where no source code has changed.
*Provide reasonable coverage for the normal activities that a user performs.


Current Method:
== Method ==


* Measure Leaks and Bloats, in a similar way to Firefox (using XPCOM_MEM_LEAK_LOG and --trace-malloc).
Current Method:
* The method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data.
*# Startup Main Mail Window
*# Open Address Book and Message Composition Windows
*# Close Address Book and Message Composition Windows
*# Quit the application


Future improvements will be discussed on the [[MailNews_Talk:Memory_Bloat_and_Leak_Tests|discussion]] page.
*Measure Leaks and Bloats, in a similar way to Firefox (using XPCOM_MEM_LEAK_LOG and --trace-malloc).
*The method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data.  
*#Startup Main Mail Window
*#Open Address Book and Message Composition Windows
*#Close Address Book and Message Composition Windows
*#Quit the application


== Results ==
Future improvements will be discussed on the [[MailNews Talk:Memory Bloat and Leak Tests|discussion]] page.


Printed via standard tinderbox methods, these will consist of:
== Results  ==


* Mail RLk
Printed via standard tinderbox methods, these will consist of:
** Reference Count Leaks
* Mail Lk
** Total Bytes malloc'ed and not free'd
* Mail MH
** Maximum Heap size
* Mail A
** Allocations - number of calls to malloc and friends.


There are currently no graphs for these results.
*Mail RLk
**Reference Count Leaks
*Mail Lk
**Total Bytes malloc'ed and not free'd
*Mail MH
**Maximum Heap size
*Mail A
**Allocations - number of calls to malloc and friends.


== Manually Running Tests ==
There are currently no graphs for these results.


=== Setting up ===
== Manually Running Tests  ==


==== Build Set up ====
=== Setting up ===


# Build Thunderbird or SeaMonkey trunk with your standard mozconfig file, but with the following options set:
==== Build Set up  ====
#* ac_add_options --enable-debug
#* ac_add_options --enable-trace-malloc


==== Profile Set Up ====
#Build Thunderbird or SeaMonkey trunk with your standard mozconfig file, but with the following options set:
#*ac_add_options --enable-debug
#*ac_add_options --enable-trace-malloc


# Enter the executable directory. Use the command:
==== Profile Set Up  ====
#* <executable_name> -createProfile <profilename>
# Now go into the /mailnews/test/performance/bloat directory and run the command:
#* python setUpBloatTest.py --binary-dir=<directory where executable is> --profile-dir=<directory for profile created in step 1>


These two commands will set up the profile the same as on the tinderbox.
#Enter the executable directory. Use the command:
#*&lt;executable_name&gt; -createProfile &lt;profilename&gt;
#Now go into the /mailnews/test/performance/bloat directory and run the command:
#*python setUpBloatTest.py --binary-dir=&lt;directory where executable is&gt; --profile-dir=&lt;directory for profile created in step 1&gt;


=== Reference Count Leak Test ===
These two commands will set up the profile the same as on the tinderbox.


# set XPCOM_MEM_BLOAT_LOG to 1 in your environment (see also [http://developer.mozilla.org/en/docs/Debugging_memory_leaks Debugging Memory Leaks])
=== Reference Count Leak Test  ===
# Start the appropriate executable (using -P <profilename> if required)
# Once the test is completed (application automatically shuts down), you'll get a dump of the objects allocated and which ones are leaking.


=== Leak, Max Heap and Allocations Test ===
#set XPCOM_MEM_BLOAT_LOG to 1 in your environment (see also [http://developer.mozilla.org/en/docs/Debugging_memory_leaks Debugging Memory Leaks])
#Start the appropriate executable (using -P &lt;profilename&gt; if required)
#Once the test is completed (application automatically shuts down), you'll get a dump of the objects allocated and which ones are leaking.


# Start the appropriate executable with the following arguments:
=== Leak, Max Heap and Allocations Test  ===
#* --trace-malloc malloc.log
#* --shutdown-leaks sdleak.log
#* -P <profilename> ''(if required)''
# Wait for the test to complete and the application to shut down.
# The malloc.log file can then be run through leakstats in the <objdir>/tools/trace-malloc/ directory to obtain the statistics:
#* leakstats malloc.log


See [http://developer.mozilla.org/en/docs/Debugging_memory_leaks Debugging Memory Leaks] for more information on what to do with this data.
#Start the appropriate executable with the following arguments:  
#*--trace-malloc malloc.log
#*--shutdown-leaks sdleak.log
#*-P &lt;profilename&gt; ''(if required)''
#Wait for the test to complete and the application to shut down.  
#The malloc.log file can then be run through leakstats in the &lt;objdir&gt;/tools/trace-malloc/ directory to obtain the statistics:
#*leakstats malloc.log


== Code Locations ==
See [http://developer.mozilla.org/en/docs/Debugging_memory_leaks Debugging Memory Leaks] for more information on what to do with this data.


The code used to drive this will be in [[Buildbot]].
== Code Locations  ==


The files specific to mailnews testing will be stored in:
The code used to drive this will be in [[Buildbot]].


/mailnews/test/performance/
The files specific to mailnews testing will be stored in:


These files consist of:
/mailnews/test/performance/


* Overlays (used to provide the hooks for the javascript):
These files consist of:  
** bloat/bloatAddrOverlay.xul
** bloat/bloatComposeOverlay.xul
** bloat/bloatMainOverlay.xul
* Javascript files (used to drive the tests):
** bloat/bloatAddrOverlay.js
** bloat/bloatComposeOverlay.js
** bloat/bloatMainOverlay.js
* Preference Settings (used to provide a defined profile, see below):
** common/mailnewsTestPrefs.js
* Python scripts (used to set up the profile):
** bloat/setUpBloatTest.py
** common/setUpCommonMailNews.py
* Perl script used to run the actual tinderbox test:
** bloat/runtest.pl


== Pre-defined profile ==
*Overlays (used to provide the hooks for the javascript):
**bloat/bloatAddrOverlay.xul
**bloat/bloatComposeOverlay.xul
**bloat/bloatMainOverlay.xul
*Javascript files (used to drive the tests):
**bloat/bloatAddrOverlay.js
**bloat/bloatComposeOverlay.js
**bloat/bloatMainOverlay.js
*Preference Settings (used to provide a defined profile, see below):
**common/mailnewsTestPrefs.js
*Python scripts (used to set up the profile):
**bloat/setUpBloatTest.py
**common/setUpCommonMailNews.py
*Perl script used to run the actual tinderbox test:
**bloat/runtest.pl


Initial Setup:
== Pre-defined profile  ==


* One POP3 account (Mails TBD)
Initial Setup:
* One Identity
* One SMTP server defined (not used)


Future requirements/possibilities:
*One POP3 account (Mails TBD)
*One Identity
*One SMTP server defined (not used)


* One Address Book where PAB has ~1000 entries
Future requirements/possibilities:
* Large Message folders
* IMAP
* NNTP Server and subscribed newsgroup.


08/04/2008: prefs.js created via TB with the above settings, the first section is for preferences included in tinderbox, the second section is ones which don't currently get set.
*One Address Book where PAB has ~1000 entries
*Large Message folders
*IMAP
*NNTP Server and subscribed newsgroup.


<pre>
08/04/2008: prefs.js created via TB with the above settings, the first section is for preferences included in tinderbox, the second section is ones which don't currently get set.
user_pref("mail.account.account1.server", "server1");
<pre>user_pref("mail.account.account1.server", "server1");
user_pref("mail.account.account2.identities", "id1");
user_pref("mail.account.account2.identities", "id1");
user_pref("mail.account.account2.server", "server2");
user_pref("mail.account.account2.server", "server2");
Line 157: Line 157:
user_pref("ldap_2.servers.osx.position", 0);
user_pref("ldap_2.servers.osx.position", 0);
user_pref("ldap_2.servers.oe.position", 0);
user_pref("ldap_2.servers.oe.position", 0);
</pre>
</pre>  
 
Preferences in generated profile, but not set:  
Preferences in generated profile, but not set:
<pre>user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail");
 
<pre>
user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail");
user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail");
user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail");
user_pref("mail.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail/Local Folders");
user_pref("mail.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail/Local Folders");
Line 171: Line 168:
user_pref("mailnews.quotingPrefs.version", 1);
user_pref("mailnews.quotingPrefs.version", 1);
user_pref("mailnews.ui.threadpane.version", 6);
user_pref("mailnews.ui.threadpane.version", 6);
</pre>
</pre>  
== Changes to Leak and Bloat Tests  ==


== Changes to Leak and Bloat Tests ==
{| border="1"
 
|-
{|border=1
| Date and Time (PST)  
|Date and Time (PST) || Description || Approx Effect on Numbers
| Description  
| Approx Effect on Numbers
|-
|-
| Pre Dec 2008 || Initial Version || -
| Pre Dec 2008  
| Initial Version  
| -
|-
|-
| 2008/12/07 11:20 || {{Bug|463594}} Disabled OS X and Outlook address books via the preference settings || Mac Lk -56.2kb.
| 2008/12/07 11:20  
| {{Bug|463594}} Disabled OS X and Outlook address books via the preference settings  
| Mac Lk -56.2kb.
|}
|}
Confirmed users
371

edits

Navigation menu