Issue #4376

This test-case is intended for Issue #4376 - Simple Memory Profiler.
Jan Odvarko, John J. Barton

This page implements several test cases, that demonstrate usage of Firebug's Memory Profiler for detecting memory leaks in a web application. You need at least Firebug 1.8a2 (or build from latest source) installed in your browser. Please post feedback in the newsgroup, thanks.

  1. Memory allocation for images
  2. Memory allocation for strings
  3. Memory leak detection
  4. Page load memory profiling
You can find further information about memory state in about:memory page.

Case 1: Memory allocation for images

This test case shows how to watch memory allocated for images.
  1. Open Firebug and enable the Console panel.
  2. Click the Memory Profile button in the Console panel toolbar to start profiling.
  3. Click the Load Image button below.
  4. Click Memory Profile again to stop profiling.

Case 2: Memory allocation for strings

This test case shows how to watch memory allocated for JavaScript strings.
  1. Open Firebug and enable the Console panel.
  2. Click the Memory Profile button in the Console panel toolbar to start profiling.
  3. Click the Allocate Strings button below (0, 1 and N times).
  4. Click Memory Profile again to stop profiling.

Case 3: Memory leak detection

This test case shows how to detect objects allocated within the Memory Profile session. These objects represent possible memory leaks.
  1. Open Firebug and enable the Console panel.
  2. Click the Memory Profile button in the Console panel toolbar to start profiling.
  3. Select the Memory Leak On option below (should be by default).
  4. Click the Create Some JS Objects button below.
  5. Click Memory Profile again to stop profiling.
Memory Leak On
Memory Leak Off

Case 4: Page load memory profiling

This test case shows how to watch memory allocated during page load phase.
  1. Open Firebug and enable the Console panel.
  2. Click the Memory Profile button in the Console panel toolbar to start profiling.
  3. Reload this page.
  4. Click Memory Profile again to stop profiling.