Click to See Complete Forum and Search --> : Printing bug in Firefox


rpatel
11-13-2007, 03:05 PM
In Firefox, printing a page containing just 5 unique png images uses about 211 MB of the system's RAM. With 10 unique png's, it uses about 337 MB of RAM. Both these figures are enough to crash or at least hang some older machines! These are not rare usage scenarios, so I'm surprised why this has never been brought up and addressed.

Does anyone know or can point me in the right direction on how I can decrease the RAM usage when printing on Firefox or workaround it? This could involve HTML, JavaScript, or absolutely anything else.

Note that this only occurs when spooling is turned on, not when printing is set to print directly to the printer.

Also, note that the maximum size of each of the png files I have on these pages is 50 KB.

Finally, my proof of concept page to test this is a very simple page composed of <img> tags wrapped in <div> tags for each image like this:

<html>
...
<div width="100%" height="100%" style='page-break-before: always;'>
<center>
<img align="center" src='Images/121451315f26582f143744515517265f51222e19425f65425c48273164345957613059241626_2.png' width=670 height=867 />
</center>
</div>
... (same block of HTML as above for each image)
</html>

Any suggestions will be greatly appreciated. Thank you.

drhowarddrfine
11-13-2007, 03:38 PM
That doesn't show or tell us anything. The reason you haven't heard of anyone addressing this issue is because no one else may have this issue.

rpatel
11-13-2007, 04:32 PM
Well, I know at least 1 other person that has this same issue. I understand what you're saying, though.

But that was not the main point of my post. I'm just looking for suggestions on how to get around the excessive memory usage when printing issue.

And if you want to confirm whether or not you have the issue to help, simply find 5 png's from the Web, copy the code I pasted below, print the resulting page, and monitor your system's RAM while the print job is sent.

Thank you.

drhowarddrfine
11-13-2007, 08:11 PM
I did it and it didn't even give a blip. Total ram for FF was 97Mb before printing and about the same during.

rpatel
11-14-2007, 10:20 AM
Actually, it's not Firefox's RAM usage that goes up. It's actually the overall system memory that takes a big dive.

So, monitor the system's memory right after you send the print job from FF. Also, make sure the page has 5 or 10 unique png images of size 25KB - 50KB.

Thanks.

gizmo
11-14-2007, 11:27 AM
So it's not a 'bug in Firefox' as you put it.:rolleyes:

rpatel
11-14-2007, 11:54 AM
The reason I say it's a Firefox bug is because this type of system behavior is only exhibited when using Firefox. Printing the exact same page in Internet Explorer results in significantly less system RAM consumption: 50 MB with 5 images and 70 MB with 10 images. These are reasonable amounts.

drhowarddrfine
11-14-2007, 12:45 PM
Parts of IE are also part of the Windows OS so this extra usage by FF is covered up by Windows when IE is running. However, like I said, I don't see any increase in memory usage but I'm on FreeBSD and not Windows so, obviously, this is an issue with Windows and not FF.

ray326
11-14-2007, 04:07 PM
Well it could be an issue with the Windows-specific code base of Fx.