Closed Bug 699218 Opened 13 years ago Closed 12 years ago

Uses a lot of "Shmem" memory on heavy sites

Categories

(Firefox :: General, defect)

12 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bugzilla, Unassigned)

Details

(Whiteboard: [MemShrink:P3])

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Build ID: 20110930100559

Steps to reproduce:

System:
Linux xxxxxx 3.0-ARCH #1 SMP PREEMPT Wed Oct 19 12:14:48 UTC 2011 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux

Firefox:
-> ./firefox -v
Mozilla Firefox 9.0a2

*New Profile*

I scrolled through this URL: https://docs.google.com/viewer?a=v&q=cache:nPvWr0Lm-iQJ:www.redhat.com/promo/summit/2008/downloads/pdf/Wednesday_1015am_John_Shakshober_and_Larry_Woodman_Decoding_the_Code.pdf+&hl=de&pid=bl&srcid=ADGEESgSJ8YIme93hrZGWt5caUKaCqJTFkcKkM1yy4CfyVyABTP-MkYy4Bpjvae4neIJEYyvy6qkLA9yG0F3uTpPI7h7YduOAq3WQI9qde1BtQjMuyxxb4Tre2-L_nFiusjMX7x5--I1&sig=AHIEtbTbm9JLlWrnWEFGkt85kkCSyc3pXQ&pli=1



Actual results:

"Shmem" in /proc/meminfo went through the roof (70 -> 570 MB) and "Cached" too. About:memory does not reflect this.

Before (in MB):
Cached:          769
Active(file):    205
Inactive(file):  554
SwapFree:        486
Shmem:            77

After (in MB)
Cached:         1278
Active(file):    206
Inactive(file):  560
SwapFree:        486
Shmem:           579

Command for displaying: cat /proc/meminfo|egrep 'SwapFree|Active\(file\)|Inactive\(file\)|Shmem|^Cached|MemFree' | awk '{printf \"%-15s %4d\n\",$1,$2/1024}'



Expected results:

Shmem should stay low especially since it accounts towards the "Cached" type of memory under Linux. People expect that "Cached" eventually gets evicted when memory pressure is high but this is not the case here. Actually this means just 500 MB more memory consumed by Firefox.
I did the test with Aurora 9.0a2 just used Fx 7 for reporting this.
Problem still exists with 12.0a2
Version: 9 Branch → 12 Branch
Whiteboard: [MemShrink]
I can more-or-less reproduce with a dev build of FF13 on my Ubuntu 11.10 box:

BEFORE
MemFree:        14235
Cached:          616
Active(file):    154
Inactive(file):  384
SwapFree:       16298
Shmem:           243

AFTER SCROLLING
MemFree:        13919
Cached:          914
Active(file):    156
Inactive(file):  391
SwapFree:       16298
Shmem:           535

AFTER WAITING ABOUT 1 MINUTE
MemFree:        14197
Cached:          640
Active(file):    156
Inactive(file):  391
SwapFree:       16298
Shmem:           261

It goes back down fairly quickly.  I'm not sure what to make of this.  I looked at 'top' and didn't see anything unusual in the SHR column for Firefox or plugin-container.
Status: UNCONFIRMED → NEW
Ever confirmed: true
So if this is an image-heavy site, what I imagine is happening is:

 * We load the page with images
 * We decode the images into Firefox's address space
 * We push the images into the X server (we call this "optimizing" the image, for some reason)
 * We discard the memory from Firefox's address space

It sounds like you may be catching Firefox while it's optimizing those images.  If so, that's not a bug.

You could check this hypothesis by looking at xrestop.
Whiteboard: [MemShrink] → [MemShrink:P3]
about:memory has this line:

  170.39 MB ── gfx-surface-xlib

which indicates lots of memory is being stored in the X server.  I think this is behaving as intended.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: