Open Bug 1960902 Opened 1 month ago Updated 8 days ago

Opening a PDF file results in a significant increase in RAM usage, exceeding 2 GB.

Categories

(Firefox :: PDF Viewer, defect, P3)

Firefox 137
defect

Tracking

()

People

(Reporter: kcchouette+mozilla, Unassigned)

Details

(Keywords: perf:resource-use)

Steps to reproduce:

  1. Navigate to the following URL: https://www.auchan.fr/catalogue/super/274980-AOHB12tZ?page=1&version=V2
  2. Click on the "Télécharger" button to download the PDF file.
  3. Monitor the RAM usage during the opening process.
  4. The PDF should open by itself using the PDF.js lib

Actual results:

The RAM usage spikes to over 2 GB

Expected results:

The RAM usage should remain within a reasonable range while opening the PDF file.

Using mozregression, here that I found:

DEBUG : Found commit message:
Bug 1934672 - Update PDF.js to new version f8d11a3a3af7c81df4ac175a2030d3bf4edff5c5 r=pdfjs-reviewers,marco

Differential Revision: https://phabricator.services.mozilla.com/D230815

DEBUG : Did not find a branch, checking all integration branches
INFO : The bisection is done.
INFO : Stopped

app_name: firefox
build_date: 2025-01-15
build_file: /home/user/.mozilla/mozregression/persist/2025-01-15--mozilla-central--firefox-136.0a1.en-US.linux-x86_64.tar.xz
build_type: nightly
build_url: https://archive.mozilla.org/pub/firefox/nightly/2025/01/2025-01-15-21-57-20-mozilla-central/firefox-136.0a1.en-US.linux-x86_64.tar.xz
changeset: f7524feb52aa820a5e877b14b4a0a02815cf3ae8
pushlog_url: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=462f654f2467c66d27121759aea4cf0675920a4c&tochange=f7524feb52aa820a5e877b14b4a0a02815cf3ae8
repo_name: mozilla-central
repo_url: https://hg.mozilla.org/mozilla-central

The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → PDF Viewer

The regressor is very likely:
https://github.com/mozilla/pdf.js/pull/19023

Most of the memory is used to create the patterns used to draw the gradient.
We should really avoid to use a pattern when when we're filling or stroking with a gradient.

Severity: -- → S3
Priority: -- → P3

I've observed a noticeable increase in memory usage while the catalogue PDF was being opened in a new tab when using Firefox 138.0.1 on Windows10 and macOS15. Based on this behavior, I'm updating the status to New.

Status: UNCONFIRMED → NEW
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.