Closed Bug 689910 Opened 8 years ago Closed 8 years ago

Memory "leak" when switching to and from private browsing

Categories

(Firefox :: General, defect)

7 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 668809

People

(Reporter: nigelh747, Assigned: ehsan)

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0
Build ID: 20110922153450

Steps to reproduce:

Started Firefox in safe mode and created about:memory 
Then went to private browsing - did another about memory
Then went back to non private mode, refreshed the "about:memory" and asked to reduce meory


Actual results:

Memory continued to climb


Expected results:

I would have expected that the "private" browsing when finished would deallocate all the memory it used and free memory.

Other tests I have done shows that Firefox 7 does reduce the memory footprint, but leaks/memory allocations still remain when tabs closed - will test that and report as found in a new bug...

Attached is the about:memory at the start and the end
Assignee: nobody → ehsan
(By the way, you can copy-paste the contents of about:memory as plain text.)
I could not reproduce this on a clean profile.  Please reopen if you have more information on how this can be reproduced.  Thanks!
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Hi Ehsan

Managed to create a local profile - empty - and reloaded.

Steps to reproduce below - looks like some of the issue is that the size of the .sqlites are bigger

Started Firefox

Went to about:Memory

Minimised Memory

Main Process

Explicit Allocations
29.81 MB (100.0%) -- explicit
├───9.95 MB (33.40%) -- heap-unclassified
├───9.30 MB (31.20%) -- storage
│   └──9.30 MB (31.20%) -- sqlite
│      ├──6.23 MB (20.91%) -- urlclassifier3.sqlite
│      │  ├──6.15 MB (20.64%) -- cache-used
│      │  └──0.08 MB (00.28%) -- (2 omitted)
│      ├──1.07 MB (03.59%) -- places.sqlite
│      │  ├──0.94 MB (03.16%) -- cache-used
│      │  └──0.13 MB (00.43%) -- (2 omitted)
│      ├──0.78 MB (02.61%) -- other
│      ├──0.50 MB (01.68%) -- (5 omitted)
│      ├──0.31 MB (01.03%) -- chromeappsstore.sqlite
│      │  ├──0.25 MB (00.84%) -- cache-used
│      │  └──0.06 MB (00.19%) -- (2 omitted)
│      ├──0.25 MB (00.82%) -- webappsstore.sqlite
│      │  ├──0.19 MB (00.63%) -- cache-used
│      │  └──0.06 MB (00.19%) -- (2 omitted)
│      └──0.16 MB (00.54%) -- cookies.sqlite
│         ├──0.16 MB (00.53%) -- cache-used
│         └──0.00 MB (00.02%) -- (2 omitted)
├───9.03 MB (30.30%) -- js
│   ├──5.71 MB (19.17%) -- compartment([System Principal])
│   │  ├──3.39 MB (11.39%) -- gc-heap
│   │  │  ├──1.61 MB (05.40%) -- objects
│   │  │  ├──1.15 MB (03.86%) -- shapes
│   │  │  ├──0.59 MB (01.99%) -- arena-unused
│   │  │  └──0.04 MB (00.14%) -- (4 omitted)
│   │  ├──1.34 MB (04.48%) -- scripts
│   │  ├──0.38 MB (01.26%) -- mjit-code
│   │  ├──0.36 MB (01.22%) -- object-slots
│   │  └──0.25 MB (00.83%) -- (4 omitted)
│   ├──2.13 MB (07.14%) -- gc-heap-chunk-unused
│   ├──0.82 MB (02.75%) -- compartment(atoms)
│   │  ├──0.46 MB (01.54%) -- string-chars
│   │  ├──0.36 MB (01.21%) -- gc-heap
│   │  │  ├──0.35 MB (01.18%) -- strings
│   │  │  └──0.01 MB (00.03%) -- (6 omitted)
│   │  └──0.00 MB (00.00%) -- (6 omitted)
│   ├──0.25 MB (00.84%) -- stack
│   └──0.12 MB (00.40%) -- (3 omitted)
├───0.87 MB (02.91%) -- xpti-working-set
├───0.46 MB (01.55%) -- layout
│   ├──0.46 MB (01.55%) -- all
│   └──0.00 MB (00.00%) -- (1 omitted)
└───0.19 MB (00.64%) -- images
    ├──0.18 MB (00.60%) -- chrome
    │  ├──0.18 MB (00.60%) -- used
    │  │  ├──0.18 MB (00.60%) -- uncompressed
    │  │  └──0.00 MB (00.00%) -- (1 omitted)
    │  └──0.00 MB (00.00%) -- (1 omitted)
    └──0.01 MB (00.04%) -- (1 omitted)

Other Measurements
318.16 MB -- vsize
 84.07 MB -- resident
 70.89 MB -- private
 32.47 MB -- heap-committed
 29.18 MB -- heap-used
  7.73 MB -- gfx-d2d-surfacevram
  6.00 MB -- js-gc-heap
  4.82 MB -- heap-unused
  1.93 MB -- heap-dirty
  0.19 MB -- gfx-surface-image
  0.11 MB -- gfx-d2d-surfacecache
  0.00 MB -- gfx-surface-win32

Then went to Private Profile Control Shift P and did that again

Then minimised the memory again

32.97 MB (100.0%) -- explicit
├──11.12 MB (33.73%) -- storage
│  └──11.12 MB (33.73%) -- sqlite
│     ├───7.90 MB (23.95%) -- urlclassifier3.sqlite
│     │   ├──7.81 MB (23.70%) -- cache-used
│     │   └──0.08 MB (00.25%) -- (2 omitted)
│     ├───1.23 MB (03.72%) -- places.sqlite
│     │   ├──1.10 MB (03.34%) -- cache-used
│     │   └──0.13 MB (00.39%) -- (2 omitted)
│     ├───0.78 MB (02.36%) -- other
│     ├───0.66 MB (02.01%) -- (6 omitted)
│     ├───0.31 MB (00.94%) -- chromeappsstore.sqlite
│     │   ├──0.25 MB (00.76%) -- cache-used
│     │   └──0.06 MB (00.17%) -- (2 omitted)
│     └───0.25 MB (00.74%) -- webappsstore.sqlite
│         ├──0.19 MB (00.57%) -- cache-used
│         └──0.06 MB (00.17%) -- (2 omitted)
├──10.67 MB (32.36%) -- heap-unclassified
├───9.66 MB (29.30%) -- js
│   ├──6.51 MB (19.74%) -- compartment([System Principal])
│   │  ├──3.57 MB (10.84%) -- gc-heap
│   │  │  ├──1.75 MB (05.31%) -- objects
│   │  │  ├──1.26 MB (03.81%) -- shapes
│   │  │  ├──0.53 MB (01.60%) -- arena-unused
│   │  │  └──0.04 MB (00.13%) -- (4 omitted)
│   │  ├──1.37 MB (04.17%) -- scripts
│   │  ├──0.69 MB (02.09%) -- mjit-code
│   │  ├──0.40 MB (01.22%) -- object-slots
│   │  ├──0.28 MB (00.85%) -- (3 omitted)
│   │  └──0.19 MB (00.58%) -- mjit-data
│   ├──1.94 MB (05.89%) -- gc-heap-chunk-unused
│   ├──0.84 MB (02.54%) -- compartment(atoms)
│   │  ├──0.47 MB (01.43%) -- string-chars
│   │  ├──0.37 MB (01.11%) -- gc-heap
│   │  │  ├──0.36 MB (01.09%) -- strings
│   │  │  └──0.01 MB (00.02%) -- (6 omitted)
│   │  └──0.00 MB (00.00%) -- (6 omitted)
│   ├──0.25 MB (00.76%) -- stack
│   └──0.12 MB (00.36%) -- (2 omitted)
├───0.87 MB (02.63%) -- xpti-working-set
├───0.46 MB (01.40%) -- layout
│   ├──0.46 MB (01.40%) -- all
│   └──0.00 MB (00.00%) -- (1 omitted)
└───0.19 MB (00.58%) -- images
    ├──0.19 MB (00.58%) -- chrome
    │  ├──0.19 MB (00.58%) -- used
    │  │  ├──0.19 MB (00.58%) -- uncompressed
    │  │  └──0.00 MB (00.00%) -- (1 omitted)
    │  └──0.00 MB (00.00%) -- (1 omitted)
    └──0.00 MB (00.00%) -- (1 omitted)
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
the increase in sqlite caches is not a leak, those caches can only grow, they never shrink, but they usually reach the needed size and stop growing (they also have a limit obviously). Btw it's memory SQLite uses, it's not leaked.
Marco - thanks - but the memory is up - and should have not as I have not done anything
Nigel, the correct way to try to reproduce the problem is to measure the memory usage when Firefox starts up, then enter and leave the PB mode many times, and then wait for some time for GC and CC to kick in (or press those buttons in about:memory a few times) and then measure the memory again.  If there is really a leak, you should see the memory usage growing dramatically.  I did not observe that in my local testing...
Hi Eshan - did this several times and the information is as below - shows a change.

Perhaps once this one is "resolved" a new bug should be raised about the memory allocated to processes (the .sqlite areas) that are not reduced to the pre - private memory position.

But back to this one
Main Process

Explicit Allocations
25.63 MB (100.0%) -- explicit
├──11.34 MB (44.24%) -- heap-unclassified
├───9.45 MB (36.87%) -- js
│   ├──6.75 MB (26.35%) -- compartment([System Principal])
│   │  ├──4.00 MB (15.59%) -- gc-heap
│   │  │  ├──2.29 MB (08.95%) -- objects
│   │  │  ├──1.57 MB (06.11%) -- shapes
│   │  │  └──0.14 MB (00.53%) -- (5 omitted)
│   │  ├──1.48 MB (05.79%) -- scripts
│   │  ├──0.53 MB (02.08%) -- object-slots
│   │  ├──0.31 MB (01.22%) -- mjit-code
│   │  ├──0.29 MB (01.14%) -- (3 omitted)
│   │  └──0.14 MB (00.53%) -- string-chars
│   ├──1.18 MB (04.60%) -- gc-heap-chunk-unused
│   ├──0.90 MB (03.50%) -- compartment(atoms)
│   │  ├──0.52 MB (02.03%) -- string-chars
│   │  ├──0.38 MB (01.46%) -- gc-heap
│   │  │  ├──0.37 MB (01.45%) -- strings
│   │  │  └──0.00 MB (00.01%) -- (6 omitted)
│   │  └──0.00 MB (00.00%) -- (6 omitted)
│   ├──0.24 MB (00.95%) -- (3 omitted)
│   ├──0.20 MB (00.79%) -- compartment(about:home)
│   │  ├──0.17 MB (00.67%) -- gc-heap
│   │  │  └──0.17 MB (00.67%) -- (7 omitted)
│   │  └──0.03 MB (00.12%) -- (7 omitted)
│   └──0.17 MB (00.68%) -- compartment(about:blank)
│      ├──0.16 MB (00.62%) -- gc-heap
│      │  └──0.16 MB (00.62%) -- (7 omitted)
│      └──0.01 MB (00.05%) -- (7 omitted)
├───3.12 MB (12.19%) -- storage
│   └──3.12 MB (12.19%) -- sqlite
│      ├──1.07 MB (04.18%) -- places.sqlite
│      │  ├──0.94 MB (03.68%) -- cache-used
│      │  └──0.13 MB (00.50%) -- (2 omitted)
│      ├──0.67 MB (02.61%) -- other
│      ├──0.39 MB (01.52%) -- (4 omitted)
│      ├──0.31 MB (01.20%) -- chromeappsstore.sqlite
│      │  ├──0.25 MB (00.98%) -- cache-used
│      │  └──0.06 MB (00.22%) -- (2 omitted)
│      ├──0.30 MB (01.18%) -- urlclassifier3.sqlite
│      │  ├──0.22 MB (00.86%) -- cache-used
│      │  └──0.08 MB (00.32%) -- (2 omitted)
│      ├──0.25 MB (00.96%) -- webappsstore.sqlite
│      │  ├──0.19 MB (00.74%) -- cache-used
│      │  └──0.06 MB (00.22%) -- (2 omitted)
│      └──0.14 MB (00.53%) -- content-prefs.sqlite
│         └──0.14 MB (00.53%) -- (3 omitted)
├───0.87 MB (03.39%) -- xpti-working-set
├───0.48 MB (01.85%) -- layout
│   ├──0.48 MB (01.85%) -- all
│   └──0.00 MB (00.00%) -- (1 omitted)
└───0.37 MB (01.46%) -- images
    ├──0.35 MB (01.37%) -- chrome
    │  ├──0.35 MB (01.37%) -- used
    │  │  ├──0.35 MB (01.37%) -- uncompressed
    │  │  └──0.00 MB (00.00%) -- (1 omitted)
    │  └──0.00 MB (00.00%) -- (1 omitted)
    └──0.02 MB (00.09%) -- (1 omitted)

Other Measurements
302.71 MB -- vsize
 74.11 MB -- resident
 63.50 MB -- private
 25.75 MB -- heap-committed
 25.07 MB -- heap-used
  7.72 MB -- gfx-d2d-surfacevram
  6.00 MB -- js-gc-heap
  1.93 MB -- heap-unused
  0.37 MB -- gfx-surface-image
  0.29 MB -- gfx-d2d-surfacecache
  0.04 MB -- heap-dirty
  0.00 MB -- gfx-surface-win32

After repeating a few times and then undertaking minimize memory

Explicit Allocations
30.17 MB (100.0%) -- explicit
├──14.82 MB (49.11%) -- js
│  ├──11.16 MB (37.00%) -- compartment([System Principal])
│  │  ├───4.10 MB (13.59%) -- gc-heap
│  │  │   ├──1.80 MB (05.95%) -- objects
│  │  │   ├──1.29 MB (04.28%) -- shapes
│  │  │   ├──0.97 MB (03.21%) -- arena-unused
│  │  │   └──0.05 MB (00.15%) -- (4 omitted)
│  │  ├───4.06 MB (13.46%) -- mjit-code
│  │  ├───1.44 MB (04.76%) -- scripts
│  │  ├───0.86 MB (02.85%) -- mjit-data
│  │  ├───0.41 MB (01.37%) -- object-slots
│  │  └───0.29 MB (00.97%) -- (3 omitted)
│  ├───2.37 MB (07.87%) -- gc-heap-chunk-unused
│  ├───0.89 MB (02.97%) -- compartment(atoms)
│  │   ├──0.50 MB (01.67%) -- string-chars
│  │   ├──0.39 MB (01.29%) -- gc-heap
│  │   │  ├──0.38 MB (01.26%) -- strings
│  │   │  └──0.01 MB (00.04%) -- (6 omitted)
│  │   └──0.00 MB (00.00%) -- (6 omitted)
│  ├───0.25 MB (00.83%) -- stack
│  └───0.14 MB (00.45%) -- (2 omitted)
├──10.35 MB (34.30%) -- heap-unclassified
├───3.46 MB (11.47%) -- storage
│   └──3.46 MB (11.47%) -- sqlite
│      ├──1.23 MB (04.07%) -- places.sqlite
│      │  ├──1.10 MB (03.65%) -- cache-used
│      │  └──0.13 MB (00.42%) -- (2 omitted)
│      ├──0.75 MB (02.48%) -- other
│      ├──0.63 MB (02.08%) -- (6 omitted)
│      ├──0.31 MB (01.02%) -- chromeappsstore.sqlite
│      │  ├──0.25 MB (00.83%) -- cache-used
│      │  └──0.06 MB (00.19%) -- (2 omitted)
│      ├──0.30 MB (01.00%) -- urlclassifier3.sqlite
│      │  ├──0.22 MB (00.73%) -- cache-used
│      │  └──0.08 MB (00.28%) -- (2 omitted)
│      └──0.25 MB (00.81%) -- webappsstore.sqlite
│         ├──0.19 MB (00.63%) -- cache-used
│         └──0.06 MB (00.19%) -- (2 omitted)
├───0.87 MB (02.88%) -- xpti-working-set
├───0.48 MB (01.59%) -- layout
│   ├──0.48 MB (01.59%) -- all
│   └──0.00 MB (00.00%) -- (1 omitted)
└───0.20 MB (00.65%) -- images
    ├──0.20 MB (00.65%) -- chrome
    │  ├──0.20 MB (00.65%) -- used
    │  │  ├──0.20 MB (00.65%) -- uncompressed
    │  │  └──0.00 MB (00.00%) -- (1 omitted)
    │  └──0.00 MB (00.00%) -- (1 omitted)
    └──0.00 MB (00.00%) -- (1 omitted)

Other Measurements
328.64 MB -- vsize
 92.75 MB -- resident
 74.27 MB -- private
 30.85 MB -- heap-committed
 25.74 MB -- heap-used
  7.72 MB -- gfx-d2d-surfacevram
  7.00 MB -- js-gc-heap
  6.26 MB -- heap-unused
  2.84 MB -- heap-dirty
  0.21 MB -- gfx-surface-image
  0.13 MB -- gfx-d2d-surfacecache
  0.00 MB -- gfx-surface-win32
Interacting with the browser causes the browser to run javascript.  Running script causes us to allocate memory.

There are tons of ways to produce bugs like this; for instance, refreshing about:memory increases our memory usage by a small amount.

Similarly, as you use the browser, it makes queries to sqlite.  Thus it's not surprising that the sqlite caches increased by .3mb.

If you managed to get Firefox's memory usage to increase by 100mb just by switching back and forth between private browsing mode, that would be a bug we'd be interested in drilling into.  But a 5mb difference is not particularly unique or worrisome.

(Note that the resident size did increase by almost 20mb, while explicit only increased by 5mb.  I suspect this is due to Firefox loading more code into memory.)
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → WONTFIX
Hi Justin

Repeated 15 times in total and managed a significant increase on the starting position.  I note your comments, however it does appear that there are at least TWO specific issues relating to Private Browsing

a) Basic increase in memory allocations / increase
b) the .sqlite areas that are NOT supposed to remember what you did in "private browsing" increase as you use Private Browsing and do not return to the original state after ending private browsing that most if not all would expect - one issue here would be that if you changed your bookmarks during private browsing - should this be maintained or lost - personally I would vote for LOST...
Status: RESOLVED → UNCONFIRMED
Resolution: WONTFIX → ---
Proof for statement above in 9

Open with about:home
Open about:memory
minimise memory usage

Main Process

Explicit Allocations
25.40 MB (100.0%) -- explicit
+--10.59 MB (41.69%) -- js
¦  +---6.70 MB (26.37%) -- compartment([System Principal])
¦  ¦   +--3.87 MB (15.22%) -- gc-heap
¦  ¦   ¦  +--1.72 MB (06.76%) -- objects
¦  ¦   ¦  +--1.25 MB (04.92%) -- shapes
¦  ¦   ¦  +--0.85 MB (03.36%) -- arena-unused
¦  ¦   ¦  +--0.05 MB (00.18%) -- (4 omitted)
¦  ¦   +--1.41 MB (05.57%) -- scripts
¦  ¦   +--0.75 MB (02.95%) -- mjit-code
¦  ¦   +--0.39 MB (01.52%) -- object-slots
¦  ¦   +--0.28 MB (01.11%) -- (4 omitted)
¦  +---2.62 MB (10.30%) -- gc-heap-chunk-unused
¦  +---0.89 MB (03.50%) -- compartment(atoms)
¦  ¦   +--0.51 MB (01.99%) -- string-chars
¦  ¦   +--0.38 MB (01.51%) -- gc-heap
¦  ¦   ¦  +--0.38 MB (01.48%) -- strings
¦  ¦   ¦  +--0.01 MB (00.03%) -- (6 omitted)
¦  ¦   +--0.00 MB (00.00%) -- (6 omitted)
¦  +---0.25 MB (00.98%) -- stack
¦  +---0.14 MB (00.54%) -- (3 omitted)
+---9.42 MB (37.07%) -- heap-unclassified
+---3.86 MB (15.18%) -- storage
¦   +--3.86 MB (15.18%) -- sqlite
¦      +--1.55 MB (06.11%) -- places.sqlite
¦      ¦  +--1.35 MB (05.32%) -- cache-used
¦      ¦  +--0.16 MB (00.61%) -- stmt-used
¦      ¦  +--0.04 MB (00.18%) -- (1 omitted)
¦      +--0.79 MB (03.09%) -- other
¦      +--0.37 MB (01.44%) -- (4 omitted)
¦      +--0.31 MB (01.21%) -- chromeappsstore.sqlite
¦      ¦  +--0.25 MB (00.99%) -- cache-used
¦      ¦  +--0.06 MB (00.22%) -- (2 omitted)
¦      +--0.30 MB (01.19%) -- urlclassifier3.sqlite
¦      ¦  +--0.22 MB (00.87%) -- cache-used
¦      ¦  +--0.08 MB (00.33%) -- (2 omitted)
¦      +--0.25 MB (00.97%) -- webappsstore.sqlite
¦      ¦  +--0.19 MB (00.74%) -- cache-used
¦      ¦  +--0.06 MB (00.22%) -- (2 omitted)
¦      +--0.16 MB (00.64%) -- cookies.sqlite
¦      ¦  +--0.16 MB (00.62%) -- cache-used
¦      ¦  +--0.00 MB (00.02%) -- (2 omitted)
¦      +--0.14 MB (00.54%) -- content-prefs.sqlite
¦         +--0.14 MB (00.54%) -- (3 omitted)
+---0.87 MB (03.42%) -- xpti-working-set
+---0.48 MB (01.87%) -- layout
¦   +--0.48 MB (01.87%) -- all
¦   +--0.00 MB (00.00%) -- (1 omitted)
+---0.19 MB (00.76%) -- images
    +--0.18 MB (00.72%) -- chrome
    ¦  +--0.18 MB (00.72%) -- used
    ¦  ¦  +--0.18 MB (00.72%) -- uncompressed
    ¦  ¦  +--0.00 MB (00.00%) -- (1 omitted)
    ¦  +--0.00 MB (00.00%) -- (1 omitted)
    +--0.01 MB (00.05%) -- (1 omitted)

Other Measurements
315.05 MB -- vsize
 81.39 MB -- resident
 68.41 MB -- private
 29.60 MB -- heap-committed
 24.40 MB -- heap-used
  8.60 MB -- heap-unused
  7.72 MB -- gfx-d2d-surfacevram
  7.00 MB -- js-gc-heap
  3.43 MB -- heap-dirty
  0.19 MB -- gfx-surface-image
  0.11 MB -- gfx-d2d-surfacecache
  0.00 MB -- gfx-surface-win32
  
  
  Multiple (5-6) Go to Private Browsing - do about:home then return
  
  Then do minimise memory
  
  Main Process
  
  Explicit Allocations
  31.08 MB (100.0%) -- explicit
  +--13.45 MB (43.29%) -- js
  ¦  +---9.58 MB (30.83%) -- compartment([System Principal])
  ¦  ¦   +--3.91 MB (12.58%) -- gc-heap
  ¦  ¦   ¦  +--1.86 MB (05.98%) -- objects
  ¦  ¦   ¦  +--1.34 MB (04.30%) -- shapes
  ¦  ¦   ¦  +--0.67 MB (02.15%) -- arena-unused
  ¦  ¦   ¦  +--0.05 MB (00.16%) -- (4 omitted)
  ¦  ¦   +--2.88 MB (09.25%) -- mjit-code
  ¦  ¦   +--1.47 MB (04.74%) -- scripts
  ¦  ¦   +--0.59 MB (01.91%) -- mjit-data
  ¦  ¦   +--0.43 MB (01.37%) -- object-slots
  ¦  ¦   +--0.30 MB (00.97%) -- (3 omitted)
  ¦  +---2.56 MB (08.23%) -- gc-heap-chunk-unused
  ¦  +---0.93 MB (02.98%) -- compartment(atoms)
  ¦  ¦   +--0.53 MB (01.70%) -- string-chars
  ¦  ¦   +--0.40 MB (01.28%) -- gc-heap
  ¦  ¦   ¦  +--0.39 MB (01.25%) -- strings
  ¦  ¦   ¦  +--0.01 MB (00.03%) -- (6 omitted)
  ¦  ¦   +--0.00 MB (00.00%) -- (6 omitted)
  ¦  +---0.25 MB (00.80%) -- stack
  ¦  +---0.14 MB (00.44%) -- (2 omitted)
  +--12.01 MB (38.64%) -- heap-unclassified
  +---4.07 MB (13.09%) -- storage
  ¦   +--4.07 MB (13.09%) -- sqlite
  ¦      +--1.61 MB (05.19%) -- places.sqlite
  ¦      ¦  +--1.41 MB (04.55%) -- cache-used
  ¦      ¦  +--0.16 MB (00.50%) -- stmt-used
  ¦      ¦  +--0.04 MB (00.14%) -- (1 omitted)
  ¦      +--0.83 MB (02.68%) -- other
  ¦      +--0.60 MB (01.93%) -- (6 omitted)
  ¦      +--0.31 MB (00.99%) -- chromeappsstore.sqlite
  ¦      ¦  +--0.25 MB (00.81%) -- cache-used
  ¦      ¦  +--0.06 MB (00.18%) -- (2 omitted)
  ¦      +--0.30 MB (00.98%) -- urlclassifier3.sqlite
  ¦      ¦  +--0.22 MB (00.71%) -- cache-used
  ¦      ¦  +--0.08 MB (00.27%) -- (2 omitted)
  ¦      +--0.25 MB (00.79%) -- webappsstore.sqlite
  ¦      ¦  +--0.19 MB (00.61%) -- cache-used
  ¦      ¦  +--0.06 MB (00.18%) -- (2 omitted)
  ¦      +--0.16 MB (00.52%) -- cookies.sqlite
  ¦         +--0.16 MB (00.51%) -- cache-used
  ¦         +--0.00 MB (00.01%) -- (2 omitted)
  +---0.87 MB (02.79%) -- xpti-working-set
  +---0.48 MB (01.55%) -- layout
  ¦   +--0.48 MB (01.55%) -- all
  ¦   +--0.00 MB (00.00%) -- (1 omitted)
  +---0.20 MB (00.65%) -- images
      +--0.20 MB (00.65%) -- chrome
      ¦  +--0.20 MB (00.65%) -- used
      ¦  ¦  +--0.20 MB (00.65%) -- uncompressed
      ¦  ¦  +--0.00 MB (00.00%) -- (1 omitted)
      ¦  +--0.00 MB (00.00%) -- (1 omitted)
      +--0.00 MB (00.00%) -- (1 omitted)
  
  Other Measurements
  325.97 MB -- vsize
   93.30 MB -- resident
   73.21 MB -- private
   31.52 MB -- heap-committed
   27.83 MB -- heap-used
    7.72 MB -- gfx-d2d-surfacevram
    7.00 MB -- js-gc-heap
    5.17 MB -- heap-unused
    1.96 MB -- heap-dirty
    0.22 MB -- gfx-surface-image
    0.13 MB -- gfx-d2d-surfacecache
    0.00 MB -- gfx-surface-win32
  

Then repeat another 10 times with private, about home return

Then do minimise memory

Main Process

Explicit Allocations
43.22 MB (100.0%) -- explicit
+--16.42 MB (37.99%) -- js
¦  +--12.67 MB (29.33%) -- compartment([System Principal])
¦  ¦  +---5.44 MB (12.58%) -- mjit-code
¦  ¦  +---4.04 MB (09.35%) -- gc-heap
¦  ¦  ¦   +--1.88 MB (04.35%) -- objects
¦  ¦  ¦   +--1.36 MB (03.15%) -- shapes
¦  ¦  ¦   +--0.75 MB (01.74%) -- arena-unused
¦  ¦  ¦   +--0.05 MB (00.11%) -- (4 omitted)
¦  ¦  +---1.49 MB (03.44%) -- scripts
¦  ¦  +---0.96 MB (02.21%) -- mjit-data
¦  ¦  +---0.43 MB (01.00%) -- object-slots
¦  ¦  +---0.33 MB (00.75%) -- (3 omitted)
¦  +---2.42 MB (05.60%) -- gc-heap-chunk-unused
¦  +---0.94 MB (02.17%) -- compartment(atoms)
¦  ¦   +--0.53 MB (01.23%) -- string-chars
¦  ¦   +--0.41 MB (00.94%) -- gc-heap
¦  ¦   ¦  +--0.39 MB (00.91%) -- strings
¦  ¦   ¦  +--0.01 MB (00.03%) -- (6 omitted)
¦  ¦   +--0.00 MB (00.00%) -- (6 omitted)
¦  +---0.25 MB (00.58%) -- stack
¦  +---0.14 MB (00.31%) -- (2 omitted)
+--13.21 MB (30.57%) -- heap-unclassified
+--12.04 MB (27.86%) -- storage
¦  +--12.04 MB (27.86%) -- sqlite
¦     +---8.27 MB (19.15%) -- urlclassifier3.sqlite
¦     ¦   +--8.19 MB (18.95%) -- cache-used
¦     ¦   +--0.08 MB (00.19%) -- (2 omitted)
¦     +---1.61 MB (03.74%) -- places.sqlite
¦     ¦   +--1.41 MB (03.27%) -- cache-used
¦     ¦   +--0.20 MB (00.46%) -- (2 omitted)
¦     +---0.83 MB (01.93%) -- other
¦     +---0.76 MB (01.76%) -- (7 omitted)
¦     +---0.31 MB (00.71%) -- chromeappsstore.sqlite
¦     ¦   +--0.25 MB (00.58%) -- cache-used
¦     ¦   +--0.06 MB (00.13%) -- (2 omitted)
¦     +---0.25 MB (00.57%) -- webappsstore.sqlite
¦         +--0.25 MB (00.57%) -- (3 omitted)
+---0.87 MB (02.01%) -- xpti-working-set
+---0.48 MB (01.10%) -- layout
¦   +--0.48 MB (01.10%) -- all
¦   +--0.00 MB (00.00%) -- (1 omitted)
+---0.20 MB (00.47%) -- (1 omitted)

Other Measurements
335.89 MB -- vsize
106.25 MB -- resident
 86.54 MB -- private
 41.88 MB -- heap-committed
 37.40 MB -- heap-used
  7.72 MB -- gfx-d2d-surfacevram
  7.00 MB -- js-gc-heap
  5.60 MB -- heap-unused
  2.46 MB -- heap-dirty
  0.22 MB -- gfx-surface-image
  0.13 MB -- gfx-d2d-surfacecache
  0.00 MB -- gfx-surface-win32
(In reply to Nigel from comment #9)
> b) the .sqlite areas that are NOT supposed to remember what you did in
> "private browsing" increase as you use Private Browsing


This does not mean sqlite is not used, some components start using a temporary storage when you switch to pb to allow you to use that component, and that means queries are run and the cache is used.

> and do not return to
> the original state after ending private browsing that most if not all would
> expect

As I explained, for performance reasons SQLite does not shrink cache size, it is a value expected to grow up till its limit, it may even be empty.

>  - one issue here would be that if you changed your bookmarks during
> private browsing - should this be maintained or lost - personally I would
> vote for LOST...

By design bookmarks are not considered as privacy implications, bookmarking means user wants to explicitly remember something, that clashes against the pb concept.
Nigel, we have a few options with this bug going forward.

* We can close it, as I'd tried to do.
* We can resolve it as a duplicate of bug 668809 or bug 411894.
* We can leave it open.

Please do whatever you'd like with this bug.  But I don't think there's anything specific we're going to fix here beyond bug 411894, which is only incidentally related.
Justin 

Happy to do any - but thought that this one that is specific - and excludes most of the sqlites would be worth working on - note that one of the largest increases in memory.

It could be that the 0.75 MB to 5.44 MB  mjit-code is correct - but its increase is significant!

Heap unclassified only increased by 50% - again an increase from 9.42Mb to 13.21 - 50% increase 

The storage allocation - especially with urlclassifier3.sqlite seems absolutley wrong - simply going to it around 10 times increases it from 0.3Mb to 8.27 MB especially as you went to the same place each time, and then removed it by coming out of private browsing - this could be the "hidden" cause of memory loss of using Firefox for a period and using over 500mb even after all tabs apart from about:memory are closed.

Thus I think I have seen three specific issues and am not sure each is covered by other bugs...
(In reply to Nigel from comment #13)
> It could be that the 0.75 MB to 5.44 MB  mjit-code is correct - but its
> increase is significant!

Indeed it is.  Dropping mjit code on GC (and therefore when you click "minimize memory usage") is bug 685358.

> Heap unclassified only increased by 50% - again an increase from 9.42Mb to
> 13.21 - 50% increase 

I don't think we should get bent out of shape by a 3.8mb memory usage increase.

> The storage allocation - especially with urlclassifier3.sqlite seems
> absolutley wrong - simply going to it around 10 times increases it from
> 0.3Mb to 8.27 MB especially as you went to the same place each time, and
> then removed it by coming out of private browsing - this could be the
> "hidden" cause of memory loss of using Firefox for a period and using over
> 500mb even after all tabs apart from about:memory are closed.

urlclassifier is known to be a hog.  This is bug 650649.
Hi Justin - thanks - looked at the other bugs and agree that they resolve two of the issues - will be awaiting Firefox 9 for the urlclassifier bug!, however I do think its worth looking at the heap unclassified - as I recall a couple of weeks ago, not with my clean profile that it had increased to over 100mb and in my current session thats been going for a couple of hours its now only 58.35 MB (33.75%) -- heap-unclassified - so has increased by over 400%
We're making a big effort to reduce the heap-unclassified number; bug 563700.  But, as you point out, we've seen much larger increases in that value than you saw in this bug.
Duping this against bug 668809; that seems like the best match.  This is a legitimate bug report, but I don't think there's anything major in here that we're not on top of.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: MatchStartupMem
And thanks a lot Nigel for your investigation here.  :-)
You need to log in before you can comment on or make changes to this bug.