Meet Firefox's Built-In PDF Reader
An anonymous reader writes "Not long ago, Mozilla coders announced that they were starting to build PDF.js, a way to display Acrobat documents in the browser using pure web code. No longer will you have to fight with an external PDF plug-in in Firefox. Development on PDF.js has progressed to the point now where you can take an early peek at it. Huzzah!"
I usually hate added features to my browser (I prefer a lightweight, fast browser), and Firefox especially has needed to go on a diet for the past year or two (and it has, successfully, since version 4), but I think that this is a pretty fundamental feature for a browser to have. After all, PDF's are everywhere on the 'net. Your browser should be able to show them to you. Gone are the days of saying "Oh, that link to an article I was barely interested in in the first place points to something in PDF format? Nevermind."
I don't want PDFs to open in the web browser. I want to open them in Acrobat in another window. Let the browser be a browser and Acrobat be Acrobat!
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
Will they include any way to turn off automated content within PDFs? What measures will they take to protect my privacy?
May be the feature that drives me away from FF ...
But it scares me. PDFs are hideously complex. Can you really do this without opening a whole new world of security vulnerabilities? I guess it's in the JavaScript engine, and that's where the security is....
:).
On an upside, it's cool to see what sort of document processing is possible when you've got as many CPU cycles as you do these days
Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
It does work, but it's still alpha quality at best.
Page layout is messed up.
No longer will you have to fight with an external PDF plug-in in Firefox.
I'm sorry but if you are fighting with the PDF plugin you're doing it wrong. Every plugin I've used to read PDFs seems to work pretty seamlessly from Acrobat to Foxit. They just work, no fighting involved.
Frankly I couldn't give a damn about the ability for browsers to read PDFs natively since on every computer I've used recently this doesn't actually add any functionality. PDFs open anyway.
What Mozilla apparently doesn't realize is that there are serious problems with Firefox that should be fixed long, long before this sort of crap is added.
1) The poor performance and the extreme memory usage. Yes, this is still a problem. It's easily reproducible with fresh Firefox installations. No, it's not a problem extensions. No, it's not a problem with plugins. No, it's not a problem with my computer (Chrome, Opera and Safari run just fine). The problem is solely with Firefox.
2) Can the "UI designers". The Firefox UI has been completely trash since Firefox 4. It is much less usable than earlier releases. Bring back the status bar. Bring back the menu bar. Bring back the protocol in the URL bar. Don't make us install extensions or resort to other hacks just to bring back this basic and integral functionality!
3) Fix the fucking auto-update process and the releases so that extensions don't break near-constantly!
4) Stop trying to imitate Chrome. If we wanted to use a browser like Chrome, we'd fucking use Chrome! If we aren't using Chrome, it's probably because we want something different.
For crying out loud, Mozilla, fix these real issues that affect every user before adding useless crap like this PDF nonsense to Firefox.
Don't mean to knock Mozilla's hard work here, but how about tackling this problem in the other direction: get rid of PDFs entirely.
Sure, PDFs are great for printing, but who prints anymore? It's 2011.
And before you say "well you can fill out forms with PDF" might I remind you that you can do the same on the web, in plain ol' HTML.
There's no -1 for "I don't get it."
Memory:
noscript, adblock, flashblock to cut down unnecessary bullshit
http://kb.mozillazine.org/Browser.sessionhistory.max_total_viewers
Bring back the protocol in the URL bar:
about:config -> browser.urlbar.trimURLs = false
TFA's about a PDF renderer running in Firefox - and what you take out of that for a security concern is the PDF renderer? Um... The horse goes in front.
Instead of spending all the time supporting pdfs, why not just ditch the format entirely and make documents with HTML?
Someone flopped a steamer in the gene pool.
I like how Chrome can display most PDFs right in the browser. No troublesome plugin required.
The last few versions of Acrobat Reader have so much bloat and need to be updated so often, it is nearly more trouble than it's worth.
To have Firefox display PDF directly is wonderful news. Good job!
there are 3 kinds of people:
* those who can count
* those who can't
I didn't even notice it was gone, but I'm pleased to have it back. Thanks!
Kid-proof tablet..
You have to be kidding.
Menu bar, Firefox Menu/Options/Menu bar
Status bar, Ctrl+/
You have already been answered about protocol, and I have not seen poor performance, memory usage could be better, but it is clear you are ignorant of Firefox and blowing it out of proportion.
PDF started out as "Portable Display Format" that showed you what a document would look like if you sent it to a decent printer.. If it had stayed that way, it would be ideal. Unfortunately Adobe succumbed to the Microsoft/Mozilla "features disease". The "latest greatest" versions now support javascript, live URLs that you can click and go to. And then there's "/launch" (it's not a security hole, it's a feature). Not to mention support for schlockwave trash.
Over the years people have complained about how every new version of Adobe Reader is more bloated, and takes longer to load than its predecessor. If Firefox offers a lightweight PDF ***READER***, I'm all for it. But puhlease, not all the stupid features in Adobe's version. Speaking of versions, the one feature I strongly suggest is that Mozilla allows its PDF engine to lie about what it is. Just like asshole webdesigners who hardcode Internet-Explorer-only into their web pages, I'm sure there are idiots who hardcode their webpages to only allow Adobe Reader above a certain version to access their PDF documents.
I'm not repeating myself
I'm an X window user; I'm an ex-Windows user
Uh, you have to download the PDF in to view it in your browser too.
Some PDF viewers can begin displaying the first page while the rest of the pages are still downloading.
If this finds it's way into FF, I'll finally will ditch FF.
They are WAY of the KISS path. Updates every week, new GUI every 6 weeks. FRELL THAT!
I want long term stability in my browser. Not this crap.
FF. Time to branch the development. One for BS and one for KISS. I'll install the plugins I need.
Oh. About:plugins. Stop breaking them every 3 months.
Privacy is terrorism.
Say I have an element <h3 id="something">something</h3> on one page of a document. On another page of the same document, how do I get the browser to calculate the page number of this element so I can write, for example, "See section 'something' (p. 5)"?
THANK you! That's been pissing me off for a while.
Please don't humanize the morons around me. It makes me very uncomfortable.
Pretty neat. Leave it to Firefox!
I know the answer to this must be no, at least in the short term, but I would think that the same engine might some day be used for that purpose, which I would use a lot, as I often save web pages, and I usually save them in that awful format with the text separated from the directory of resources, because that's what every browser, even old models, can read. It would be nice to save web pages or even web sites from the browser into pdf, like I used to do with Adobe Acrobat, back when I could afford to buy such things.
So how do I make that link turn into a page number reference once printed? I guess I could make each document available as both HTML for viewing on a scrolling screen and PDF for paper or an e-ink screen, but that isn't "ditch[ing] the format entirely".
The only reason I had Google Chrome (and deleted all of its updating components!) was to look at PDF files.
If Firefox can eventually do this job as nicely as that old Chrome version, then goodbye, Chrome!
That's still far more effort than should be necessary to make visible things that never should have been hidden in the first place.
The problem isn't even so much that they're gone, but rather that the Mozilla dev team was stupid enough to remove them in the first place.
4) Stop trying to imitate Chrome. If we wanted to use a browser like Chrome, we'd fucking use Chrome! If we aren't using Chrome, it's probably because we want something different.
Hey, Konqueror had integrated kpdf into the browser way before Chrome existed.
...for adding a capability Safari has had for over five years. :)
But seriously - the sooner we get to a point where all major browsers have this capability built-in, the sooner we can be free of the abomination that is "Acrobat plugin."
Village idiot in some extremely smart villages.
Me either. But it doesn't seem to hide it if it's anything other than HTTP, so it's still unambiguous. I decided to leave the feature on.
Property is theft.
Opening PDF files in the browser is great and all, but I would be more interested in using this lib to programmatically create PDF files from what is in the browser. This would be particularly useful as svg gets wider adoption. Right now, the process requires conversion to canvas as an intermediate step.
I'm sorry, but your opinion seems to be wrong.
"Meet Firefox's Built-In PDF Exploit Hole"
I use Google docs thanks.
A "page" or "slide" is a division of a document that is the same size as a viewport. Progression through a document made of pages is done by showing the next or previous page in the entire viewport. The analogy is to a codex, which has two pages on each sheet of paper, or a set of film slides loaded into a projector, which presents one page on the screen.
Layout for paged media uses different techniques from layout for an unbounded vertical scrolling document. Pages are typically given sequential numbers displayed in a "footer" at the bottom of each page. The title of a document may be shown in a "header" across the top of each page, analogous to the "title bar" in a scrolling windowed environment. A footnote may be shown at the bottom of the page where it is first referenced, instead of at the end of a document. Figures and tables are rarely split from one page to another. And in general, it's a bad idea to leave one line of a paragraph at the top of a page.
I didn't notice that it was gone either. btw, even with the URL trimmed, it still shows "https://" for secure sites.
something else firefox have that will cause every program running to hang for 30 seconds at a time.
1) The poor performance and the extreme memory usage. Yes, this is still a problem. It's easily reproducible with fresh Firefox installations.
We have a whole team of engineers devoted to memory usage, and a second team devoted to performance. If you have issues you can reproduce, especially on a clean Firefox install, we'd love it if you'd file a bug. We can only fix problems we're aware of, and we're not aware of any huge leaks in the versions we're shipping.
http://bugzilla.mozilla.org/
Who said anything about leaks?
Figure out what makes your browser so FAT.
In my program SaltOS (an online CRM / ERP), I added a online PDF reader using programs as convert and pdfinfo on the server. When the user wanted to view a PDF online, the server must convert all pages to images and all images were transferred to the client. With PDF.JS I can remove the dependency of the two programs on the server and I have only to send the PDF to render the document in the client. I have to say that the results are very good. All PDF generated by my application will automatically be displayed correctly without any plugin. Thanks to the Mozilla team by this great library.
That's all I got. But I like the idea. It just needs a bit of work .... 100%
While a PDF reader undeniably widens the attack surface for exploits, I don't think this is going to be much more a security hazard than supporting some new extra features of HTML5.
And adding it to Firefox might induce Google to open source Chrome's PDF engine (assuming they haven't licensed it from a third party).
What people apparently don't realize is that there are way too many features in PDF to do a quick and dirty viewer.
It will probably work on some simple PDFs created by a "print to PDF" tool, but once you start viewing more advanced PDFs you will be in trouble.
Some time ago we switched from Adobe Reader to a competitor PDF reader where I work, and we still encounter PDFs that view OK in Adobe but fail in the new viewer.
Especially (but not only) PDFs that contain user fillable forms cause trouble.
The experience is much like using another browser than Internet Explorer was 5 years ago.
Often it worked, but frequently you encountered pages that won't render or function correctly.
Perhaps the high memory usage is not actually a leak, and the browser is just "working as designed". Despite that it can still be considered a problem to the users.
Here's an example (firefox 3.6.23). Yesterday I had many mozilla windows and tabs open. The browser took up 600MB. I closed everything except one one window with one tab, and opened a new tab, and closed the other tab (so there is no page to go "Back" to).
The browser process still took up 400MB. Why? Note: I am using noscript, adblock plus, treestyle tabs and certificate patrol.
I just tried it on another mozilla browser that does not have treestyle tabs (but with noscript, adblock plus and certificate patrol), on start up: 67MB. Opened up slashdot, classic discussion, opened a few large articles, got that browser process to 170+MB. Opened Google in a new window (so no cacheable "back history") . Closed everything else. Browser process drops from 170MB to 105MB. So what is the extra 30+MB for?
For people who only use Mozilla that may not be a problem since the 400MB may be buffers or cached data that Mozilla can reuse again.
But many people use other applications as well - word processors, email programs, spreadsheets, virtual machines, development environments. So if they close browser windows and the browser does not return the unnecessary memory to the operating system for use by their other applications unless they close the ENTIRE browser, to them that is a BUG.
Maybe you can have a configurable for "browser only machine" vs "Multitask machine".
No, I am not going to upgrade to your latest major version[1]. I see no proof that you guys fixed the problem. That said, mozilla has improved over the years, thanks.
[1] BTW it's pretty stupid of you guys to mess about with the version numbers for no good reason. At worst case do what the other stupid companies do: have a marketing version number (for those who care about the bullshit) and a technical version number (for those who care about the tech and truth).
PDFs are used for high-quality text rendering suitable to print long documents (papers, thesis, etc.).
Web technologies simply *do not* offer that kind of high-fidely rendering. Even the operating-sytem-provided font rendering is far behind the font rendering capabilities of most PDF viewers.
Implementing PDF by making them render HTML is simply utterly stupid and pointless.
It's essentially like trying to view flickr in VGA text-mode. It's possible, but I don't think ascii art is quite good enough to convey the information behind HD photographs.
I had about 19 Windows open, at least a hundred tabs in each Window and was baffled to only see Firefox using just over a gig for all those pages. So, I closed all the other tabs but this slashdot page, left it for ten minutes (using Firefox 7.0.1 with Certificate Patrol, HTTPS-everywhere, British-English dictionary addons, Flash plugin - Nothing else, not even the skype addon), it's at 109MiB RAM now. I don't understand the problem?
I'm just not seeing this "extreme memory usage".
Change is certain; progress is not obligatory.
I bet you are running an Intel multicore. try it on an AMD single or low end dual core and watch how quickly you change your tune. Frankly i wouldn't be the least bit surprised to find out that Moz is using the Intel crippler compiler which completely cripples anything compiled on it with regards to AMD products. I have noticed that after the 3.6 branch FF performance has gone REALLY downhill with regards to AMD chips. When it runs better on a P4 than a brand new AMD multicore? yeah smells like the Intel compiler to me.
I have to support ALL makes and models of both Intel and AMD so having FF run like shit on half the CPUs really doesn't cut it. I have found browsers based on Chromium (currently using Dragon, but I've found this to be true with Chrome and Chromium as well) simply don't have this problem with AMD CPUs so again I bet Moz is using the crippler compiler.
ACs don't waste your time replying, your posts are never seen by me.
Of course, the ideal solution (not only for the browser/PDF reader problem) would be to have a standardized way to tell an application to start raised/lowered
This is sort of what I was talking about. For example, even in Windows XP, a shortcut to an application can already specify that the application shall run minimized.
... ever since jslinux booted a Linux 2.6.20 image.
In Firefox, JavaScript runs 386!
=S
..when Chrome did this :P
Seems to me that Firefox is now in the position that its forebear Mozilla was some 10 years ago. Mozilla in its default form was a monstrous behemoth of a thing, and I used to build my own browser-only versions that were a lot smaller, faster and more powerful than the Firefox (or Phoenix, as it was then known) versions.
Of course, I eventually went with the flow and accepted Firefox into my life as support for the earlier codebase fell away, and never regretted it. More recently, however, I have adopted Chromium for its smaller footprint on my screenspace.
However, I find this unnecessary dissing of Firefox a bit tiresome. It has served us well, and still does. If the user insists on keeping 150 tabs open at once, he has no right to complain that the thing is hogging memory. If he can't be bothered keeping track of what he's reading, why should anyone else? Why not simply bookmark tabs, close them and move on?
Good question, I don't think you can. The CSS Print Profile keeps track of a current page counter, but I think you only have access to the current page number for presentation and styling; you can't query another element and ask what page it's on. So you have to do references by section number, and when printing arrange for the current section's number to show up in the page header or footer.
=S
> No, I am not going to upgrade to your latest major version[1]. I see
> no proof that you guys fixed the problem. That said, mozilla has improved over the years, thanks.
How are you going to see proof if you don't try the latest version? You clearly don't read Bugzilla, or you'd know there was a fuckload of a lot of work done on memory consumption after 1.9.2*
*using internal version numbers because you hate marketing ones.
Do daemons dream of electric sleep()?
> I bet Moz is using the crippler compiler.
You lose.
Mozilla uses gcc for Linux and related platforms, Visual Studio for Windows, and Apple's gcc for Mac OS/X. The Solaris contrib builds are built with the Sun Studio compiler (or whatever it's called these days).
x86_64 is regularly benchmarked, and you can see perf improvements/works on various platforms at http://arewefastyet.com./
Additionally, if you are aware of specific x86_64 performance problems, you should bring them to the attention of the folks at Mozilla (via Bugzilla).
Also, "runs like shit" does not count as specific.
Do daemons dream of electric sleep()?
Wasn't firefox originally intended to have a LIGHT footprint by being modular and relying mostly on extensions to provide functionality beyond basic web browsing? PDF is not basic web browsing. You might as well include routines for MSOffice documents too. And mp3s, and movies, and pretty soon we've got one gargantuan program that does everything and does it badly when all we wanted to do was look at cat pictures.
Oh great, yet another PDF renderer that I will be forced to test. Chrome is annoying enough. It has had issues with our PDFs for 5 of the last 8 releases. And now Firefox is planning on adding in this experimental half-baked piece of crap? Yet another reason for me to recommend we drop official support for Firefox.
Don't give me that crap.
Look at all the memory problems in bugzilla. Fact is it's only till Firefox 7 there's this memshrink stuff. Didn't the mozilla bunch claim it was fixed in version 3, 3.5, 3.6, 4, 5 and version 6?
So why is there the need for this memshrink stuff if they told the truth before?
Blame me for not upgrading. But I'll still blame the Mozilla devs. For the past 5 or 6 years I've tried upgrading to solve the problem every time people say they've fixed it. Each time they haven't. So given the Mozilla dev team's track record, maybe by Firefox 8 or 9 it'll really be fixed.
As for the improvements I was talking about. it used to be Mozilla would crash if a website just sneezed at it. IMO the reason for Netscape's demise wasn't mainly Microsoft, but Netscape's crappy product itself - look at how many years it took for Mozilla to get usable. The codebase must have been pretty crap. Compare with the progress Google has made with in a much shorter space of time, basing on webkit.
Yes Google Chrome is a bigger memory hog in many cases, but it's process based, so if the windows/processes you no longer need are closed, the memory is returned to the OS. So Google Chome could be a bigger leaking pile of shit, but the real world impact is less- you close/kill the offending processes and the memory is freed up without affecting the other browser sessions.
Leave that out of the Mac OS X version. Macs can display PDFs files just as easily as JPEGs.
Well, it used to screw up in editing/modifying/copying of portions of a URL, but they seem to have that pretty much solved.
-- perl -e'print pack"H*","6e656d6f406d38792e6f7267"'
I don't understand why people get so mad about this.
I'm sorry that you don't trust Mozilla to deliver on its promises any longer. I wish you'd check out the new version of Firefox, because we've put a lot of work into improving it. But hey, it's free software, and if you want to run a browser released in January 2010, more power to you!
The good news is that Firefox, Chrome, and Opera work on Windows, Mac, and Linux. You have options; nobody's making you use Firefox.
But maybe next time before you assert that memory usage is "still a problem", you could try the latest version. If you never upgrade your browser, you're never giving us a chance to fix anything.
maybe by Firefox 8 or 9 it'll really be fixed.
What are they, miracle workers? Give them more than a couple of weeks to work on the problem.
I'll believe in corporations having personhood when Texas executes one... - advocate_one
Sorry can't keep track. Did I leave out some zeroes?
OK I tried it. I after getting the memory usage up to 700MB by opening many tabs and windows (slashdot and some news sites), I then closed everything except one tab, opened a new window to the default Firefox start page, closed old window. After waiting a minute or two, usage went down to about 180+MB. Is it supposed to still be using 180MB? No added extensions at all.
And don't say I never upgrade my browser. I've upgraded it a few times already. Fact is it's only till Firefox 7 there's this memshrink stuff. Didn't the Mozilla bunch claim the memory problems were fixed in version 3, 3.5, 3.6, 4, 5 and version 6?
Go ahead blame me for not wanting to waste my time upgrading only to face the same problem.
Didn't the Mozilla bunch claim the memory problems were fixed in version 3, 3.5, 3.6, 4, 5 and version 6?
As I recall, the claim was that memory problems were addressed in 3, 3.5, 3.6, 4, 5, and 6, not that your memory problems were fixed. It was before my time, but there was a concerted memory-usage effort in the 3 - 3.5 timeframe. You're right in that it's only in Firefox 7 that the results of our latest big memory push have seen the light of day. But that doesn't mean we didn't fix any problems in the meantime.
Go ahead blame me for not wanting to waste my time upgrading only to face the same problem.
In the amount of time it took you to write this post to Slashdot, you could have done each of these browser upgrades. We even save your tabs across upgrades. But like I said, my issue isn't that we lost your trust through bad PR -- that's our fault -- but rather that you claimed that memory usage is "still a problem" when you hadn't tried the latest version!
Is it supposed to still be using 180MB?
You can open up about:memory and see exactly where that 180mb is going, if you're curious. I'd love for our after-closing-tabs memory usage to be smaller, but with our current architecture, we're never going to be as small after you've used the browser as when you first start up. 180mb isn't abnormally high.
We've improved things in upcoming versions, too, but I'm not promising miracles. :)
OK here's what I got from about:memory (curiously repeatedly clicking on minimize memory seems to increase some memory use numbers, after the initial reduction).
111.74 MB (100.0%) - explicit
+-44.45 MB (39.78%) - js
l +-33.23 MB (29.74%) - compartment([System Principal])
l l +-15.13 MB (13.54%) - gc-heap
l l l +-7.52 MB (06.73%) - objects
l l l +-4.47 MB (04.00%) - shapes
l l l +-1.98 MB (01.77%) - arena-unused
l l l +-1.05 MB (00.94%) - strings
l l l +-0.12 MB (00.10%) - (3 omitted)
l l +-9.34 MB (08.36%) - mjit-code
l l +-2.94 MB (02.63%) - scripts
l l +-2.42 MB (02.16%) - string-chars
l l +-1.94 MB (01.73%) - object-slots
l l +-1.37 MB (01.23%) - mjit-data
l l +-0.09 MB (00.08%) - (2 omitted)
l +-6.65 MB (05.95%) - gc-heap-chunk-unused
l +-3.33 MB (02.98%) - compartment(atoms)
l l +-1.97 MB (01.77%) - string-chars
l l +-1.36 MB (01.22%) - gc-heap
l l l +-1.18 MB (01.05%) - strings
l l l +-0.18 MB (00.16%) - (6 omitted)
l l +-0.00 MB (00.00%) - (6 omitted)
l +-1.24 MB (01.11%) - (7 omitted)
+-37.88 MB (33.90%) - heap-unclassified
+-26.91 MB (24.08%) - storage
l +-26.91 MB (24.08%) - sqlite
l +-21.48 MB (19.23%) - urlclassifier3.sqlite
l l +-21.40 MB (19.15%) - cache-used
l l +-0.08 MB (00.07%) - (2 omitted)
l +-2.62 MB (02.34%) - (12 omitted)
l +-1.92 MB (01.72%) - places.sqlite
l l +-1.63 MB (01.46%) - cache-used
l l +-0.29 MB (00.26%) - (2 omitted)
l +-0.88 MB (00.79%) - other
+-1.09 MB (00.98%) - layout
l +-1.09 MB (00.98%) - all
l +-0.00 MB (00.00%) - (1 omitted)
+-0.87 MB (00.78%) - xpti-working-set
+-0.53 MB (00.48%) - (1 omitted)
Other Measurements
342.00 MB - vsize
172.50 MB - resident
165.39 MB - private
127.55 MB - heap-committed
102.08 MB - heap-used
91.92 MB - heap-unused
24.00 MB - js-gc-heap
2.55 MB - heap-dirty
0.46 MB - gfx-surface-win32
0.00 MB - canvas-2d-pixel-bytes
0.00 MB - gfx-d2d-surfacecache
0.00 MB - gfx-d2d-surfacevram
0.00 MB - gfx-surface-image
(some characters replaced/deleted to get past Slashdot's lame lameness filter).
So I see the 110MB "explicit". What's using the rest? Note this is after closing everything down from a peak of 330MB.
The vsize value seems different from the windows reported VM size ( about 170MB).
So I see the 110MB "explicit". What's using the rest?
Let's see. Part is heap fragmentation. That's heap-committed - heap-used = 25mb. The rest is probably code. On my Linux machine, we load about 35mb of code (about half are shared libraries). 25mb + 35mb + 110mb = 170, which is very close to your 172.5mb of resident.
There are a lot of things here that we can improve. urlclassifier (phishing protection) does not need to use 20mb of memory; someone is working on this. We don't know where 1/3 of your memory is going (heap-unclassified); it's a slog, but we improve this a little in each version. 25mb of heap fragmentation is more than I'd like, and we're working to update our malloc library, jemalloc, to the newest version, which will hopefully improve this. I've also done some work to reduce the number of calls we make to malloc() in the first place, which has helped some.
As you can see, there's room for improvement, but we have to fix a number of small things to get a big change.
The vsize value [342mb] seems different from the windows reported VM size (about 170MB).
I think task manager may be counting only private bytes, but Firefox is counting everything in its virtual address space. On my Windows 7 VM, Firefox's vsize matches Process Explorer's virtual size column. If these don't match for you, that's probably a bug!
As a proof of concept to get the ball rolling, I've been porting an MPEG-1 decoder to JavaScript with support for WebCL for decoding acceleration and WebGL for color space and scaling acceleration. The reason I chose MPEG-1 is because it's easy to work with as a starter project and proof of concept. H.264 employs pretty much all the same principles as MPEG-1, in fact, H.264 doesn't really do much entirely different than MPEG-1, it's been almost all simple evolution (don't argue it... there's nothing really that special in H.264 that wasn't in MPEG-1... the filters were just makeup on the pig).
:)
The fact is.... the video tag is the dumbest thing I've ever seen and the time and effort would have been better invested in making something like a WebAL project which would allow Ecmascript to perform time synchronization between WebGL and WebAL for audio output. By the time the video tag is worth while, both WebM and H.264 will be last generation codecs and then what do we do? Start another bitching match over which one to choose next? How well did that work for getting rid of GIF... which still is everywhere... well unless they replaced them with flash at least.
With technologies like WebCL coming up fast and WebGL already pretty well supported, by the time someone actually manages to implement the codecs in web technologies, it'll be possible to view any video format on any browser without the need of codecs on the device, the codec would simply download along with the video. If you're worried about whether it'll be fast enough... that's rubbish, WebCL is just as fast as OpenCL and you can operate directly on WebGL contexts. The only issue remaining is audio. And let's be brutally honest... audio does not take that much CPU to decode (yes... I know about <insert your shitty engineered lossless codec here, they don't count). So having an audio context which allows passing of buffers from OpenCL to the audio output would be fine.
I look forward to showing off soon
I'm using Windows XP SP3. The task manager's "Mem Usage" column appears to be the same as process explorer's "Working Set" column.
Here's another one from today: Firefox 7.0.1 after opening and closing many tabs, then closing everything except one window. Opening a new window, having about:memory, closing the other window.
I'm not too clear on what's "explicit" usage, heap-committed and heap-used numbers, and what shows up in Process Explorer. To me what actually counts is whatever that would make the computer start to swap- even if the rest are small/tiny. That's the main thing right? As far as I understand Private Bytes cannot be used by other apps, so if that keeps going up, the computer will start running out of memory.
Process explorer says:
Peak Private bytes = 674MB
Private bytes=239MB
Working Set = 247MB
Virtual Size =631MB
Task manager says:
Mem Usage: 247MB
VM Size= 239MB
Threads = 36
Mozilla says:
135.57 MB (100.0%) - explicit
+-67.89 MB (50.08%) - js
l +-38.87 MB (28.67%) - compartment([System Principal])
l l +-19.02 MB (14.03%) - gc-heap
l l l +-6.92 MB (05.10%) - arena-unused
l l l +-6.85 MB (05.05%) - objects
l l l +-4.18 MB (03.08%) - shapes
l l l +-0.94 MB (00.70%) - strings
l l l +-0.14 MB (00.10%) - (3 omitted)
l l +-11.21 MB (08.27%) - mjit-code
l l +-2.91 MB (02.15%) - scripts
l l +-2.02 MB (01.49%) - string-chars
l l +-1.87 MB (01.38%) - object-slots
l l +-1.59 MB (01.17%) - mjit-data
l l +-0.24 MB (00.18%) - (2 omitted)
l +-23.54 MB (17.36%) - gc-heap-chunk-unused
l +-3.50 MB (02.58%) - compartment(atoms)
l l +-2.10 MB (01.55%) - string-chars
l l +-1.40 MB (01.03%) - gc-heap
l l l +-1.18 MB (00.87%) - strings
l l l +-0.22 MB (00.16%) - (6 omitted)
l l +-0.00 MB (00.00%) - (6 omitted)
l +-0.89 MB (00.66%) - compartment(http://finance.yahoo.com/q?s=1295.KL)
l l +-0.89 MB (00.66%) - (8 omitted)
l +-0.73 MB (00.54%) - gc-heap-chunk-admin
l +-0.36 MB (00.26%) - (4 omitted)
+-37.88 MB (27.94%) - heap-unclassified
+-28.04 MB (20.68%) - storage
l +-28.04 MB (20.68%) - sqlite
l +-22.68 MB (16.73%) - urlclassifier3.sqlite
l l +-22.59 MB (16.67%) - cache-used
l l +-0.08 MB (00.06%) - (2 omitted)
l +-2.37 MB (01.75%) - (11 omitted)
l +-2.02 MB (01.49%) - places.sqlite
l l +-1.73 MB (01.27%) - cache-used
l l +-0.30 MB (00.22%) - (2 omitted)
l +-0.96 MB (00.71%) - other
+-0.89 MB (00.66%) - (2 omitted)
+-0.87 MB (00.64%) - xpti-working-set
Other Measurements
616.33 MB - vsize
319.58 MB - heap-unused
239.49 MB - resident
231.73 MB - private
188.06 MB - heap-committed
123.42 MB - heap-used
45.00 MB - js-gc-heap
1.95 MB - heap-dirty
0.68 MB - gfx-surface-win32
0.37 MB - canvas-2d-pixel-bytes
0.00 MB - gfx-d2d-surfacecache
0.00 MB - gfx-d2d-surfacevram
0.00 MB - gfx-surface-image
So Is it correct to say that Mozilla (even 7.0.1) often can't return some of the unused private bytes, and that can keep growing as the user opens and closes stuff?
There are many users who hardly ever shutdown their computers (just suspend/hibernate) and even their browsers. But over time they might still close and reopen some browser windows.
I suspect that's why despite Chrome being a fatter (and possibly leakier) browser, such users may think Firefox is worse in practice. From what I see, with Chrome opening and closing some windows/tabs usually frees up all the memory involved - the process just goes away returning the memory to the OS (and letting the geniuses in charge of the OS take care of fragmentation - not the browser's problem anymore ;) ). This appears to be true for IE as well (I haven't looked really closely - hardly ever use it :) ).
The current Firefox approach may require you all to also do what the OS bunch are doing or trying to do: e.g. http://kerneltrap.org/memory
FWIW, it looks like you may not have left Firefox idle long enough to trigger a GC before you took this about:memory screenshot -- there's still a compartment for Yahoo Finance open. You can click "minimize memory usage" at the bottom of the page to force all our timers to fire.
To me what actually counts is whatever that would make the computer start to swap- even if the rest are small/tiny. That's the main thing right?
Right. This also means that peak memory usage -- which isn't what people on Slashdot usually talk about -- is just as important, if not more important, than memory usage after closing all tabs. It's when we're at our peak that we're most likely to cause swapping.
So Is it correct to say that Mozilla (even 7.0.1) often can't return some of the unused private bytes, and that can keep growing as the user opens and closes stuff?
I'm not sure if that growth is unbounded. I'm also not sure how much this growth affects our peak memory usage -- a lot of this fragmentation leaves gaps which we can fill in when you open new tabs.
But yes, it's correct that no version of Firefox uses as little memory after you close all tabs as it does when it first starts up.
From what I see, with Chrome opening and closing some windows/tabs usually frees up all the memory involved - the process just goes away returning the memory to the OS (and letting the geniuses in charge of the OS take care of fragmentation - not the browser's problem anymore ;)
Well, you can't fragment physical memory, because all pages are the same size! (Well, modern chips expose different-sized pages, but I'm not aware of this being used on any consumer device.) The heap fragmentation in this latest about:memory dump is pretty bad...
But architecturally, Chrome definitely has a leg up on us here. There's only so much we can do as-is. We're working to make architectural changes to match Chrome, but it's slow going.
I did leave it open for a while till it stopped shrinking and I also clicked on "minimize mem usage".
FWIW the yahoo thing is still there despite the tab not being there. I did reopen that link again some minutes ago. How long do I have to wait till it goes away?
Basically what I did was open up a folder with a number of yahoo finance sites. Then open it again, and again, then close the middle bunch. then open folder, then close, repeat a few times ( I guess I kinda abused firefox a bit, but that was only for a short while). Then closed all the windows and tabs, except one. Opened new window, closed old window, go to about:memory, clicked on minimize mem button a few times. Wrote slashdot post. Then did other stuff, then recently I checked some businessweek finance pages. Then now I've closed everything except about:memory and this slashdot form.
And it looks a bit like this:
149.84 MB (100.0%) - explicit
+-72.12 MB (48.13%) - js
l +-44.37 MB (29.61%) - compartment([System Principal])
l l +-20.68 MB (13.80%) - gc-heap
l l l +-7.51 MB (05.01%) - objects
l l l +-7.31 MB (04.88%) - arena-unused
l l l +-4.75 MB (03.17%) - shapes
l l l +-0.96 MB (00.64%) - strings
l l l +-0.15 MB (00.10%) - (3 omitted)
l l +-14.09 MB (09.40%) - mjit-code
l l +-3.08 MB (02.05%) - scripts
l l +-2.10 MB (01.40%) - string-chars
l l +-2.07 MB (01.38%) - object-slots
l l +-1.72 MB (01.15%) - mjit-data
l l +-0.64 MB (00.43%) - (2 omitted)
l +-21.63 MB (14.44%) - gc-heap-chunk-unused
l +-3.85 MB (02.57%) - compartment(atoms)
l l +-2.45 MB (01.63%) - string-chars
l l +-1.40 MB (00.94%) - gc-heap
l l l +-1.21 MB (00.81%) - strings
l l l +-0.19 MB (00.13%) - (6 omitted)
l l +-0.00 MB (00.00%) - (6 omitted)
l +-1.30 MB (00.87%) - (5 omitted)
l +-0.97 MB (00.65%) - compartment(http://finance.yahoo.com/q?s=1295.KL)
l +-0.97 MB (00.65%) - (8 omitted)
+-46.44 MB (30.99%) - heap-unclassified
+-29.07 MB (19.40%) - storage
l +-29.07 MB (19.40%) - sqlite
l +-23.21 MB (15.49%) - urlclassifier3.sqlite
l l +-23.13 MB (15.43%) - cache-used
l l +-0.08 MB (00.06%) - (2 omitted)
l +-2.44 MB (01.63%) - places.sqlite
l l +-2.11 MB (01.40%) - cache-used
l l +-0.34 MB (00.23%) - (2 omitted)
l +-2.41 MB (01.61%) - (11 omitted)
l +-1.01 MB (00.67%) - other
+-0.87 MB (00.58%) - xpti-working-set
+-0.85 MB (00.57%) - layout
l +-0.85 MB (00.57%) - all
l +-0.00 MB (00.00%) - (1 omitted)
+-0.49 MB (00.33%) - (1 omitted)
Other Measurements
608.74 MB - vsize
291.18 MB - heap-unused
269.96 MB - resident
261.20 MB - private
214.35 MB - heap-committed
134.82 MB - heap-used
45.00 MB - js-gc-heap
2.24 MB - heap-dirty
0.57 MB - gfx-surface-win32
0.00 MB - canvas-2d-pixel-bytes
0.00 MB - gfx-d2d-surfacecache
0.00 MB - gfx-d2d-surfacevram
0.00 MB - gfx-surface-image
Anyway as I've written this the private mem seems to have dropped a bit after I opened a few more windows and is now 259MB. The yahoo thing is still there, so maybe I've found a bug? Not sure if it's easily reproduceable.
I guess I can put up with it if it takes a long while before the minimum usage hits 400MB. But I haven't really been using Facebook much with Firefox 7.0.1 (was using Chrome for it). Maybe will try that tomorrow...
Chrome's approach is sweeping the problem under the carpet, but every now and then the carpet and everything under gets incinerated ;).
p.s. Is the Content Security Policy stuff gaining traction? About 9 years ago I proposed to mozilla.security and a w3c list to create a tag for disabling active content (or some other way of doing it). Everyone was busy creating new and fancy "Go Pedal", there was no "Stop Pedal", the only way to stop was to make sure all the "Go Pedal" were disabled/escaped (even new unknown ones ;) ), which I thought was insane. But nobody else really seemed interested back then.
I did leave it open for a while till it stopped shrinking and I also clicked on "minimize mem usage".
FWIW the yahoo thing is still there despite the tab not being there. I did reopen that link again some minutes ago. How long do I have to wait till it goes away?
If you click minimize memory usage, everything should go away immediately. If you don't, I'm not sure how long you have to wait; five minutes (without touching Firefox) should be sufficient.
Are you running with extensions? It's probably an extension bug which is causing that yahoo compartment to stay there. If you can reproduce without any extensions, please file a bug and cc :jlebar. If not, then you may want to get in touch with the extension author (and you're welcome to file a bug and cc me anyway).
p.s. Is the Content Security Policy stuff gaining traction?
I have no idea whether people are using CSP, but apparently there's a WordPress plugin. :) http://people.mozilla.com/~bsterne/content-security-policy/wordpress.html
Yeah, it's a conspiracy, not the cheap chip you use.