|
|
(13 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| <small>[[MailNews:Performance Testing|<< Back to MailNews:Performance Testing]]</small> | | <small>[[MailNews:Performance Testing|<< Back to MailNews:Performance Testing]]</small> |
|
| |
|
| __TOC__
| | '''NOTE: This page (and its related talk page) has been moved to the [https://developer.mozilla.org/en/MailNews/Leak_And_Bloat_Tests Mozilla Developer Center]. Please refer to that page for recent updates and discussions.''' |
| | |
| <div style="border: thin dotted #aaa; padding:5px;">
| |
| '''Please do not edit this page unless you are on the Thunderbird or SeaMonkey MailNews team. Your feedback and comments are welcomed on the [[MailNews_Talk:Memory_Bloat_and_Leak_Tests|discussion page]].'''</div><br> | |
| | |
| ''Note: MailNews here refers to either Thunderbird, or the Mail/Newsgroups/Address Book part of SeaMonkey''
| |
| | |
| The second version of the test files have been posted in {{bug|427980}}.
| |
| | |
| The [http://tinderbox.mozilla.org/SeaMonkey/ SeaMonkey tinderbox] "Linux nye Dep bloat" is now running the first version of the test files.
| |
| | |
| == Aim ==
| |
| | |
| * 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.
| |
| | |
| == Method ==
| |
| | |
| Initial Method:
| |
| | |
| * 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 Window, close it
| |
| *# Open Message Composition Window, close it
| |
| *# Close Main Mail Window
| |
| | |
| To be added at a later stage:
| |
| | |
| * Large Message folders and selection thereof.
| |
| * Large Address Books.
| |
| * Sending/Receiving on different protocols (this would run best with local servers being setting up i.e. same physical hardware).
| |
| | |
| == Results ==
| |
| | |
| Printed via standard tinderbox methods, these will consist of:
| |
| | |
| * 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 ==
| |
| | |
| === Setting up ===
| |
| | |
| ''Note until the patches on {{bug|427980}} are checked in, this process won't work without the patches being manually applied.''
| |
| | |
| ==== Build Set up ====
| |
| | |
| # Build Thunderbird or SeaMonkey trunk with your standard mozconfig file, but with the following options set:
| |
| #* mk_add_options MOZ_CO_MODULE="mozilla/tools/trace-malloc mozilla/testing/mailnews"
| |
| #* ac_add_options --enable-debug
| |
| #* ac_add_options --enable-trace-malloc
| |
| # Copy the following two files in <objdir>/dist/bin/chrome of your build:
| |
| #* mozilla/testing/mailnews/bloat/bloatTestOverlay.js
| |
| #* mozilla/testing/mailnews/bloat/bloatTestOverlay.xul
| |
| # Create a text file called "mailnewstest.manifest" in the <objdir>/dist/bin/chrome directory of your build.
| |
| # Fill the text file with the following (replacing the /path/to/objdir with the correct path):
| |
| | |
| <pre>
| |
| content mailnewstest file:////path/to/objdir/dist/bin/chrome/
| |
| overlay chrome://messenger/content/messenger.xul chrome://mailnewstest/content/bloatTestOverlay.xul
| |
| overlay chrome://messenger/content/addressbook/addressbook.xul chrome://mailnewstest/content/bloatTestOverlay.xul
| |
| overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://mailnewstest/content/bloatTestOverlay.xul
| |
| </pre>
| |
| | |
| You will now be able to run SeaMonkey or Thunderbird from the object directory and the automation suite will run (but you won't get the leak or bloat output). If you want the profile set up to match as well, see the section below.
| |
| | |
| ==== Profile Set Up ====
| |
| | |
| # Enter the executable directory. Use the command:
| |
| #* <executable_name> -createProfile <profilename>
| |
| # Now go into the mozilla/testing/mailnews/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.
| |
| | |
| === Reference Count Leak 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 <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 ===
| |
| | |
| # Start the appropriate executable with the following arguments:
| |
| #* --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.
| |
| | |
| == Code Locations ==
| |
| | |
| The existing [http://mxr.mozilla.org/seamonkey/source/tools/tinderbox/ tinderbox code] will be used to drive the tests, this may require migrating to [[Buildbot]] at an appropriate stage.
| |
| | |
| The files specific to mailnews testing will be stored in:
| |
| | |
| /mozilla/testing/mailnews/bloat/
| |
| | |
| These files consist of:
| |
| | |
| * An overlay (bloatTestOverlay.xul) which is used to overlay the main windows and loads bloatTestOverlay.js
| |
| * An script (bloatTestOverlay.js) which is used to drive the actual tests.
| |
| | |
| They can currrently be found in {{bug|427980}}
| |
| | |
| == Pre-defined profile ==
| |
| | |
| Initial Setup:
| |
| | |
| * One POP3 account (Mails TBD)
| |
| * One Identity
| |
| * One SMTP server defined (not used)
| |
| | |
| Future requirements/possibilities:
| |
| | |
| * One Address Book where PAB has ~1000 entries
| |
| * 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.
| |
| | |
| <pre>
| |
| user_pref("mail.account.account1.server", "server1");
| |
| user_pref("mail.account.account2.identities", "id1");
| |
| user_pref("mail.account.account2.server", "server2");
| |
| user_pref("mail.accountmanager.accounts", "account1,account2");
| |
| user_pref("mail.accountmanager.defaultaccount", "account2");
| |
| user_pref("mail.accountmanager.localfoldersserver", "server1");
| |
| user_pref("mail.identity.id1.fullName", "Tinderbox");
| |
| user_pref("mail.identity.id1.smtpServer", "smtp1");
| |
| user_pref("mail.identity.id1.useremail", "tinderbox@invalid.com");
| |
| user_pref("mail.identity.id1.valid", true);
| |
| user_pref("mail.root.none-rel", "[ProfD]Mail");
| |
| user_pref("mail.root.pop3-rel", "[ProfD]Mail");
| |
| user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
| |
| user_pref("mail.server.server1.hostname", "Local Folders");
| |
| user_pref("mail.server.server1.name", "Local Folders");
| |
| user_pref("mail.server.server1.type", "none");
| |
| user_pref("mail.server.server1.userName", "nobody");
| |
| user_pref("mail.server.server2.check_new_mail", false);
| |
| user_pref("mail.server.server2.directory-rel", "[ProfD]Mail/tinderbox");
| |
| user_pref("mail.server.server2.download_on_biff", true);
| |
| user_pref("mail.server.server2.hostname", "tinderbox");
| |
| user_pref("mail.server.server2.login_at_startup", false);
| |
| user_pref("mail.server.server2.name", "tinderbox@invalid.com");
| |
| user_pref("mail.server.server2.type", "pop3");
| |
| user_pref("mail.server.server2.userName", "tinderbox");
| |
| user_pref("mail.smtp.defaultserver", "smtp1");
| |
| user_pref("mail.smtpserver.smtp1.hostname", "tinderbox");
| |
| user_pref("mail.smtpserver.smtp1.username", "tinderbox");
| |
| user_pref("mail.smtpservers", "smtp1");
| |
| user_pref("mail.startup.enabledMailCheckOnce", true);
| |
| user_pref("mailnews.start_page_override.mstone", "1.9pre");
| |
| </pre>
| |
| | |
| Preferences in generated profile, but not set:
| |
| | |
| <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.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail/Local Folders");
| |
| user_pref("mail.server.server2.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/Mail/tinderbox");
| |
| user_pref("mail.attachment.store.version", 1);
| |
| user_pref("mail.folder.views.version", 1);
| |
| user_pref("mail.spam.version", 1);
| |
| user_pref("mailnews.quotingPrefs.version", 1);
| |
| user_pref("mailnews.ui.threadpane.version", 6);
| |
| </pre>
| |