Last Comment Bug 51028 - memory usage for images is ~46% worse than nc4.75/ie5.5
: memory usage for images is ~46% worse than nc4.75/ie5.5
Status: RESOLVED WORKSFORME
[adt needinfo]
: 4xp, footprint, perf, testcase
Product: Core
Classification: Components
Component: ImageLib (show other bugs)
: Trunk
: All All
: P3 major with 26 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://timeless.justdave.net/stress/s...
: 98930 116257 122581 (view as bug list)
Depends on: slowGIF 296818
Blocks: 124608
  Show dependency treegraph
 
Reported: 2000-09-01 01:21 PDT by timeless
Modified: 2009-04-14 08:11 PDT (History)
55 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
stress.html saved from http://timeless.haque.net/mozilla/stress.html (125.09 KB, text/plain)
2002-03-05 13:05 PST, Cathleen
no flags Details
another HTML showing the problem (using Yahoo images) (8.22 KB, text/html)
2002-03-06 10:28 PST, Gabor Liptak
no flags Details
Another testcase: png image (72 KB) with 10k-15k size (71.39 KB, image/png)
2005-08-31 17:57 PDT, Stebs
no flags Details

Description timeless 2000-09-01 01:21:11 PDT
the bug url is a bit extreme, ~65k html file which re
Comment 1 timeless 2000-09-01 01:34:52 PDT
oops
... -quires 885MB of [virtual] memory in nc4.75/ie5.5
moz needed 1300+MB.

I will generate a more reasonable testcase.

http://wam.umd.edu/~soref/mstress.html ~1K,
ie5.5: 26832K/19544K
moz:   42604K/35224K
          mem/vm
Comment 2 sairuh (rarely reading bugmail) 2000-09-01 12:26:05 PDT
talkback info, albeit sparse:

Incident ID 16672285 
 Trigger Time 
                2000-09-01 01:48:33 
 Email Address 
                timeless@bemail.org 
 User Comments 
 Build ID
                2000082815 
 Product ID
                Netscape6 
 Platform ID
                Win32 
 Stack Trace

nsFileTransport::Process
[d:\builds\seamonkey\mozilla\netwerk\base\src\nsFileTransport.cpp, line 511] 
Comment 3 sairuh (rarely reading bugmail) 2000-09-01 12:28:44 PDT
here's a better trace, ignore the one above.

Incident ID 16672002 
 Trigger Time 
                2000-09-01 01:38:39 
 Email Address 
                timeless@bemail.org 
 User Comments 
                please attach to
http://bugzilla.mozilla.org/show_bug.cgi?id=51028 
 Build ID
                2000082815 
 Product ID
                Netscape6 
 Platform ID
                Win32 
 Stack Trace

nsFileTransport::Process
[d:\builds\seamonkey\mozilla\netwerk\base\src\nsFileTransport.cpp, line 511] 
nsFileTransport::Run
[d:\builds\seamonkey\mozilla\netwerk\base\src\nsFileTransport.cpp, line 363] 
nsThreadPoolRunnable::Run
[d:\builds\seamonkey\mozilla\xpcom\threads\nsThread.cpp, line 694] 
nsThread::Main [d:\builds\seamonkey\mozilla\xpcom\threads\nsThread.cpp, line 96] 
_PR_NativeRunThread [pruthr.c, line 421] 
0x006f006d 
KERNEL32.DLL + 0x37cd (0x77e837cd) 
Comment 4 timeless 2000-09-01 12:31:32 PDT
the crashes happen by loading http://wam.umd.edu/~soref/ostress.html ~2k [well 
mozilla "finish"es but doesn't render it all], and then clicking reload.
Comment 5 timeless 2000-09-01 14:11:05 PDT
Just a guess from the stack trace ->networking:cache
Comment 6 neeti 2000-09-01 14:14:32 PDT
-->gagan
Comment 7 timeless 2000-09-21 03:15:04 PDT
9/13-12: on my large testcase: <1100mb vm needed which is only 23% worse 
than nc4.75/ie5.5 (that's a 200+mb savings)
24772/31704K (4mb saved), we still don't load all images on mstress.

Gagan, if you can't reproduce the crash, kick this back to imagelib or layout 
or compositor; I can't.
Comment 8 Gagan 2000-09-21 14:20:33 PDT
this is really an overall memory usage issue. ->warren.
Comment 9 Chris Waterson 2000-12-05 16:19:13 PST
taking
Comment 10 gordon 2001-02-09 17:43:52 PST
Changing component.  It doesn't look cache specific.
Comment 11 Chris Waterson 2001-03-05 21:54:38 PST
libpr0n fixes this, right pav?
Comment 12 timeless 2001-03-28 20:16:42 PST
Lib pr0n makes this much wrose :-( i was at ~1.95GB of ram for the large 
testcase [119% worse than competition, and browser doesn't actually respond] 
this test run was done in a w2k terminal session w/ [peak mem usage 2510864, 
current 550456 - after killing mozilla] @256 colors.
Comment 13 saari (gone) 2001-03-28 20:50:12 PST
There is definitely something wrong here, even at 24bit color we shouldn't be
eating that much memory.
Comment 14 Stuart Parmenter 2001-03-30 02:04:53 PST
removing 'crash' keyword.  This is an out of memory problem potentially 
resulting in a crash, but not a crash due to anything specific.
Comment 15 Colin Stewart 2001-06-04 21:01:03 PDT
Is the huge memory uptake and long load time (I haven't let it finish yet on my
machine before killing mozilla) on
http://www.12see.de/hpm_design01.cgi?user=funnylady (Select the "Gif's Gif's
Gif's" link) this bug?

Loads quickly and takes only 11MB in Opera 5.0 for Linux, takes 100% CPU usage
and over 70MB in Mozilla 2001060408-trunk
Comment 16 Manoj 2001-06-27 07:30:22 PDT
I am using Mozilla Build ID: 2001060703 on NT4.0. The start up memory image of
this build is 17346KB while that of IE6.0 (the beta release) is only 6000 and
odd KB. I had mozilla on last night and when I came into to work this morning, I
found that it had used up 76MB of memory space! Now that is an astronomical
figure, in contrast, IE rarely takes more than 20MB. Someone needs to look at
the way mozilla handles memory and why it isn't flushing unused memory blocks.
Comment 17 Chad Austin 2001-06-27 17:01:55 PDT
Windows 2000
P3 500
128 MB


IE 5.5

mem: 82 M
VM:  866 M


IE 6

mem: 35 M
VM:  1,317 M


Mozilla 2001062708 (0.9.2)

mem: 53 M
VM:  1,381 M


IE6 and Mozilla are very close...

Anyone have XP?
Comment 18 Chad Austin 2001-06-28 13:32:02 PDT
NS 4.7something on win2k:

mem: 37 M
VM:  798 M
Comment 19 kmaraas 2001-07-09 03:50:50 PDT
http://wam.umd.edu/~soref/mstress.html

Testing build 2001070321 (gnucc-295) on Linux 2.4.x gives:
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
24055 kmaraas    9   0 53624  49M  9392 S     0,0 26,4   2:14 mozilla-bin

Which amounts to ~40 MB?
Comment 20 Steve Dagley 2001-07-10 00:17:46 PDT
Fizilla build from 0_9_2 branch under Mac OS X 10.0.4: 1,890,164 kbytes

IE 5.whatevercomeswith Mac OS X 10.0.3               : 1,806,004 kbytes
Comment 21 Anatoly Kochergin 2001-07-10 02:14:24 PDT
http://wam.umd.edu/~soref/mstress.html
 on Windows 2000, 16 bit color, RAM = 256MB

NN4.7       10M
IE6 (beta)  25M
M 0.9.2     44M

It's still the problem.
Comment 22 Bob Jacobson 2001-07-13 18:09:47 PDT
I agree.  Moz 0.9.2+ freezes up for many seconds after the browser dispenses
with one page and fills with another.  It's really annoying.  IE 5.0 doesn't do
this.  I prefer open source.
Comment 23 RFLazaro 2001-08-26 22:34:04 PDT
i am using build 2001082608 on WinNT and tried to load the pages mentioned

http://wam.umd.edu/~soref/stress.html
http://wam.umd.edu/~soref/mstress.html

there was nothing displayed whatsoever, this was even if i tried to reload the
said pages
Comment 24 saari (gone) 2001-08-30 14:57:31 PDT
didn't work for me either the first time, but the second attempt in a new window
worked. Odd
Comment 25 Tom Everingham 2001-08-30 18:23:30 PDT
qa -> tpreston
Comment 26 Not doing reviews right now 2001-09-09 01:01:54 PDT
*** Bug 98930 has been marked as a duplicate of this bug. ***
Comment 27 Kent Fitzsimmons 2001-10-22 06:57:35 PDT
Additionally, if you use many browser windows (control-N) in IE, memory usage
with IE (any version 5 or above, I'm using 6) is much lower than Mozilla
(currently using 0.9.5). 

In fact, just browsing with about 6 Moz windows open uses up all of my 192M
within about 1/2 hour to 1 hour (W2K) while I can browse all day with IE and
have no problems.

Sorry about the lack of a test case, but this is really obvious if you do it for
a while.
Comment 28 basic 2002-02-09 08:09:19 PST
bug 104999 (that has just been fixed) should help with this abit.
Comment 29 Michael Gabriel 2002-02-20 16:22:41 PST
46% ? i would say 900% ! in bugzilla, request ALL unconfirmed bugs ... ie and ns
both use like 40 megs, mozilla 0.9.8 requires 400! megs. thats just hillarious
Comment 31 Marko Macek 2002-02-21 23:56:42 PST
for 0.9.8:

as you know windows 2000 will swap mozilla out overnight leading to extremely 
slow response each morning. today I was watching the task manager display
as mozilla was being paged in.

it showed VM size for mozilla.exe at 66MB. mozilla was totally unresponsive
(no screen repaint, no nothing) until the Memory Usage field got up to 45MB.
As I loaded the bugzilla.mozilla.org it got to 55MB.

This seems to show that mozilla has a huge working set (perhaps the heap gets
fragmented over time).

Then after checking some mails, moving them aroung, doing a few bugzilla queries
to find this bug it shows both Memory at 118MB and VM at 121MB

The machine has 512 MB RAM and shows 256MB used in task manager.
Comment 32 timeless 2002-02-22 03:16:43 PST
sorry guys, you want some other bug, this is an *IMAGELIB* bug
Comment 33 Gagan 2002-03-05 11:52:03 PST
dp, cathleen: can you guys help/comment on this one? [adt needinfo]
Comment 34 Cathleen 2002-03-05 13:03:53 PST
We need a new valid test case for this bug!  Otherwise, this bug is useless.

these links do not work
http://wam.umd.edu/~soref/mstress.html
http://wam.umd.edu/~soref/ostress.html 

comment #30
http://bugzilla.mozilla.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&status_whiteboard=&status_whiteboard_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time
is not an imagelib issue, this is a query generating a bugzilla list of 23461
bugs, which took a huge load of memory.  There is already an bug filed, see bug
49539, which has nothing to do with image.

The URL link provided on top of bug report
http://timeless.haque.net/mozilla/stress.html works.  However, nothing gets
rendered after page gets done loading.  This is same with IE.  So, I saved the
page, and look at all image links in page source, and found there is no valid
access to those image files.  I will attatch stress.html for people to view.
Comment 35 Cathleen 2002-03-05 13:05:47 PST
Created attachment 72658 [details]
stress.html saved from http://timeless.haque.net/mozilla/stress.html

no access to any of the images specified in this page.	--> test invalid.
Comment 36 timeless 2002-03-05 23:26:58 PST
aww that sucks. ok, i think i found someone with a webserver who can host the 
files. i should have more info in 24hrs
Comment 37 timeless 2002-03-06 10:01:14 PST
ok, the files are now up on the server in the url, if you can mirror them instead of constantly hitting the server, that'd probably be good.

index.html mstress.html ostress.html slurp-stress.html slurp.html stress.html

you should be able to use wget or netscape composer to slurp the files.
Comment 38 Gabor Liptak 2002-03-06 10:28:08 PST
Created attachment 72809 [details]
another HTML showing the problem (using Yahoo images)

another HTML showing the problem (using Yahoo images)

Mozilla takes twice of IE's footprint to display this HTML file

BTW JPEG images seem to be worse than GIF images
Comment 39 Cathleen 2002-03-08 19:05:47 PST
I did a spacetrace analysis using attachment 72809 [details] and it showed 100 calls to
imglib, which holds around 120MB.

task manager showed us using 120+MB to load this page and IE5 took 42+MB to load.

saari is going to take a look at this.  he guessed implementing paletted gifs
will help, 3 to 1 ratio.
Comment 40 Stuart Parmenter 2002-03-08 20:14:26 PST
Those images are PNGs and the ones on the old testcase were JPEGs.  GIF fixes
are irrelivant to this.
Comment 41 saari (gone) 2002-03-09 00:25:17 PST
Palettized image storage in general then. I'm guessing PNG uses a palettized
format anyway, and if you look at the content of the images, you can see where
IE is getting the win; it is an obvious 3:1 ratio.

We can teach each decoder to go directly to native paletized formats when
appropriate (my choice), or we can take a temporary decode to full 3 byte per
pixel, keep color statistics, and then make a decision on if it should be
palettized (< 256 colors). My vote is the first option; more work but better
results. I'm willing to punt on JPEGs as they're meant to be used when GIF isn't
the best choice: large amounts of colors often seen in photographs where LZW
starts falling down anyway.
Comment 42 Gabor Liptak 2002-03-09 06:35:43 PST
If GIF-s are not relevant to this, should a new bug to filed for the GIF problem?
Comment 43 ArronM (:paper) 2003-01-14 21:34:54 PST
*** Bug 116257 has been marked as a duplicate of this bug. ***
Comment 44 ArronM (:paper) 2003-01-14 21:40:44 PST
Bug 143046 is the windows only (currently) GIF solution to this bug.  1 bit/8
bit PNGs should also use the framework that Bug 143046 is trying to set up.
Comment 45 Not doing reviews right now 2003-04-24 21:19:43 PDT
*** Bug 122581 has been marked as a duplicate of this bug. ***
Comment 46 Andrew Church 2003-04-25 18:24:16 PDT
(from comment 16 of bug 122581:) Page with 141 1280x960 images, each shrunk to
160x120 using WIDTH and HEIGHT attributes in IMG tag, requires 1GB RAM
(allocated to Mozilla while decoding, X afterwards).  Netscape 4.05 requires
only 50MB (Netscape+X11 combined) for the same page, and loads 2-3 times faster
as well.  Shouldn't Mozilla only keep the shrunk image in memory, not the full one?
Comment 47 Samir Gehani 2003-04-30 17:21:01 PDT
adt: nsbeta1-
Comment 48 Jay Davis 2003-11-19 11:01:12 PST
Can someone please update this bug with more example web pages?  Thank you much.
Comment 49 timeless 2003-11-20 08:44:00 PST
Please slurp only once. I will try to retest stress locally, but i currently
have a mozilla which crashed due to OOM after using about 700mb of vm, so I
don't think mozilla has a chance of loading this page.
Comment 50 Andrew Church 2003-11-27 19:29:54 PST
I set up a small (~250kB including images) test page at
http://achurch.org/51028/ .  NC4.78 doesn't even break a sweat; Mozilla chews
through memory like crazy without displaying anywhere near all of the images
(and dies from OOM on both a 512MB Windows box and a 1.5GB Linux box, both
Mozilla 1.6a).
Comment 51 Mikko Virkkilä 2003-12-11 15:06:19 PST
Using Mozilla 1.4 (20030821) on Linux I tried the site mentioned in comment #50.
I had a window open showing top (sorted according to mem usage) and noticed it
wasn't mozilla-bin eating my memory but X. 
Comment 52 Andrew Church 2003-12-11 18:22:27 PST
Since Netscape doesn't cause X to take up such huge amounts of memory, I'd argue
that Mozilla is at fault.
Comment 53 Brian 'netdragon' Bober 2003-12-11 20:37:27 PST
This affects Windows to, and on Windows it does bloat Mozilla process memory, so
I'd agree Mozilla is at fault.
Comment 54 timeless 2003-12-11 22:45:57 PST
andrew church: could you get a stack trace w/ gdb? :)
I will try to fix any oom crashes for which you provide a stack.
You're welcome to file such stack traces in new bugs and reference them here,
since we probably shouldn't clutter this bug with them (although I did cause
some clutter in comments 2 and 3).
Comment 55 Andrew Church 2003-12-12 01:10:07 PST
Unfortunately, it's killed by the OOM killer, so I can't get any stack traces.
Comment 56 Markus Hübner 2004-02-16 09:00:48 PST
Any progress on that?
Comment 57 Daniel de Wildt 2004-04-14 00:55:50 PDT
I think the URL example results in a "memory cache overflow". Each image is
stored decoded in the memory cache even if the memory cache is already full.
While loading the page about:cache increases and "Storage in use" will exceed
"Maximum storage size". 

I have seen this also in bug 213391 comment 5. If bug 213391 is a dupe of this
then other bugs with this memory cache behaviour (like bug 105370) could also be
dupes of this bug.
Comment 58 Alexander Opitz 2004-07-16 15:47:44 PDT
The account from timeless had moved to our new server so I changed the URL.
Comment 59 Carfield Yim 2004-08-12 00:00:26 PDT
I affected by the problem also, and IE don't suffer from this, may be we should
put the image in disk rather than at Memory??
Comment 60 Stebs 2005-08-31 17:57:34 PDT
Created attachment 194498 [details]
Another testcase: png image  (72 KB) with 10k-15k size

PNG Image as Testcase that shows huge memory usage (over 400 MB). Memory Usage
of IE with same PNG is far less.
Not really sure this is the right Bug, there are a lot Bugs about images and
huge memory usage: is Bug 240369 only about .bmp?
Tested with: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4)
Gecko/20050831 Firefox/1.0+ ID:2005083106
Comment 61 Michael Gabriel 2005-09-01 05:06:20 PDT
even worse for me, moz 1.8b on win2k, while rendering memory usage goes over 1.1
gig, then calms down to 550megs once image is shown. stalls the system for a
good minute tho...
Comment 62 Alex Staubo 2005-11-25 14:38:34 PST
This bug has been quiet for a while, with no apparent solution in sight. This analysis seems relevant:

  http://primates.ximian.com/~federico/news-2005-11.html

While I think the scheme suggested by the author is sound enough, I would also suggest memory-mapping the in-memory images to the cache, at least for non-visible/inactive tabs; in my experience it's a good idea to let the kernel dynamically distribute memory to apps.

Bug 240369 looks like a dupe of this bug, can anyone confirm?
Comment 63 Jo Hermans 2005-12-02 04:09:37 PST
(In reply to comment #62)
> This bug has been quiet for a while, with no apparent solution in sight. This
> analysis seems relevant:
> 
>   http://primates.ximian.com/~federico/news-2005-11.html

see bug 259672
Comment 64 Alex Staubo 2005-12-02 09:20:14 PST
(In reply to comment #63)
> see bug 259672

Not talking about X; the excessive memory usage problem also exists on Windows.
Comment 65 Michel Poleur 2007-05-22 22:27:16 PDT
When trying to view the attachment "Another testcase", I get this error message :

The image “https://bugzilla.mozilla.org/attachment.cgi?id=194498” cannot be displayed, because it contains errors.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Comment 66 timeless 2007-10-29 02:04:01 PDT
for reference, bug 296818 has significantly improved things. someone will comment here with numbers.
Comment 67 Simon Howes 2007-10-29 02:18:48 PDT
All with emptied disk cache set to 404800 running the stress test;

Page was loaded, then slowly scrolled to the bottom.

Camino Version 2007102701 (2.0a1pre)
294MB real, 656MB virtual.
Cache: Storage in use: 	130418 KiB

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a9pre) Gecko/2007102804 Minefield/3.0a9pre
323MB real, 681MB virtual.
Cache: Storage in use: 	130093 KiB

Comment 68 Simon Howes 2007-10-29 02:46:22 PDT
For completeness:

Safari Version 2.0.4 (419.3)
625.75MB real, 1.03GB virtual.

Oh, with a beach ball of death that lasted nearly 10 minutes.
Comment 69 Justin Dolske [:Dolske] 2007-10-29 03:22:21 PDT
Note that the numbers may vary over time. EG, when I ran the testcase with Minefield the VM size was ~1.1GB immediately after running the test. It then dropped to ~700MB after a bit (296818's work), and then scrolling through the whole page increased it back again.
Comment 70 Alfred Kayser 2009-04-14 01:24:15 PDT
The original testcase requires 885MB of [virtual] memory in nc4.75/ie5.5,
but now in Firefox 3.5b4pre it requires less than 450K (with some other tabs open and a lot of addons active).
So, I would say the original reported problem that that page requires more memory than nc4.75 is no longer applicable...

Note You need to log in before you can comment on or make changes to this bug.


Privacy Policy