Closed Bug 1047431 Opened 10 years ago Closed 8 years ago

High CPU and memory usage on cutroni.com page due to repeated loading of scripts

Categories

(Firefox :: Untriaged, defect)

31 Branch
x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: bygrandao, Unassigned)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140716183446

Steps to reproduce:

Open the following site
http://cutroni.com/blog/2006/09/21/google-analytics-configuration-mistake-2-query-string-variables/


Actual results:

Firefox CPU usage  goes to 50% (2 core, 4 thread processor) and memory usage start increasing (4GB system) until the whole system hangs
Notice that this bug occurs also with some other urls since version 30
Component: Untriaged → General
Component: General → Untriaged
Could you create a clean profile (see https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles) and load the URL then save the memory log (type about:memory then click on "measure and save"), then attach the memory-report.json.gz to the bug.
Flags: needinfo?(bygrandao)
Flags: needinfo?(bygrandao)
Nicholas, I CCed you, but I don't know if you're still the referee for memory issues in Firefox. :)

I tried with old FF17, same memory issue, it looks like the webpage is loading some scrips endlessly.
Flags: needinfo?(n.nethercote)
Whiteboard: [MemShrink]
It looks like the page is doing something stupid. In the attached about:memory
dump, there are 1187(!) copies of jquery loaded, and 1186(!) copies of some
analytics script.

> 2,018.38 MB (100.0%) -- explicit
> ├────962.62 MB (47.69%) -- window-objects
> │    ├──955.59 MB (47.34%) -- top(http://cutroni.com/blog/2006/09/21/google-analytics-configuration-mistake-2-query-string-variables/, id=8)
> │    │  ├──593.12 MB (29.39%) -- active
> │    │  │  ├──587.78 MB (29.12%) -- window(http://cutroni.com/blog/2006/09/21/google-analytics-configuration-mistake-2-query-string-variables/)
> │    │  │  │  ├──558.61 MB (27.68%) -- js-compartment(http://cutroni.com/blog/2006/09/21/google-analytics-configuration-mistake-2-query-string-variables/)
> │    │  │  │  │  ├──408.24 MB (20.23%) ++ objects
> │    │  │  │  │  ├───75.61 MB (03.75%) ++ scripts
> │    │  │  │  │  ├───48.22 MB (02.39%) ++ shapes
> │    │  │  │  │  ├───26.51 MB (01.31%) ++ type-inference
> │    │  │  │  │  └────0.03 MB (00.00%) ++ (2 tiny)
> │    │  │  │  ├───27.40 MB (01.36%) ++ dom
> │    │  │  │  └────1.76 MB (00.09%) ++ (3 tiny)
> │    │  │  └────5.35 MB (00.26%) ++ (5 tiny)
> │    │  ├──361.79 MB (17.93%) -- js-zone(0x95f4800)
> │    │  │  ├───91.53 MB (04.53%) ++ strings
> │    │  │  ├───83.71 MB (04.15%) ++ lazy-scripts
> │    │  │  ├───75.86 MB (03.76%) ── unused-gc-things
> │    │  │  ├───53.57 MB (02.65%) ++ type-objects
> │    │  │  ├───52.04 MB (02.58%) ── type-pool
> │    │  │  └────5.08 MB (00.25%) ++ (2 tiny)
> │    │  └────0.67 MB (00.03%) ++ cached/window(about:home)
> │    └────7.03 MB (00.35%) ++ (5 tiny)
> ├────542.44 MB (26.88%) ── heap-unclassified
> ├────450.25 MB (22.31%) -- js-non-window
> │    ├──419.67 MB (20.79%) -- runtime
> │    │  ├──274.96 MB (13.62%) ── source-data-cache
> │    │  ├──133.52 MB (06.62%) -- script-sources
> │    │  │  ├───60.39 MB (02.99%) -- source(scripts=1187, http://code.jquery.com/jquery-1.7.1.min.js)
> │    │  │  │   ├──60.28 MB (02.99%) ── compressed
> │    │  │  │   └───0.11 MB (00.01%) ── misc
> │    │  │  ├───51.12 MB (02.53%) -- source(scripts=1186, http://d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/xa48ljrifk/analytics.min.js)
> │    │  │  │   ├──50.96 MB (02.52%) ── compressed
> │    │  │  │   └───0.16 MB (00.01%) ── misc
> │    │  │  └───22.01 MB (01.09%) ++ (38 tiny)
> │    │  └───11.19 MB (00.55%) ++ (11 tiny)
> │    └───30.58 MB (01.52%) ++ (2 tiny)
> ├─────47.70 MB (02.36%) ++ heap-overhead
> └─────15.37 MB (00.76%) ++ (22 tiny)

I loaded this page in Firefox and monitored it for a minute or so. Memory usage
climbed up to about 1.1 GiB, and CPU bounced around between 70% and 140%.

I did the same with Chromium, and memory usage climbed to 1.6 GiB, and CPU
hovered between 90 and 100%.

|perf top| tells me that Firefox is spending a lot of time in JS parsing and
source compression. This isn't surprising given the repeated loading of the
scripts.

There are also bazillions of JS errors being reported -- many repeats of this:

> JavaScript error: , line 0: uncaught exception: [object Object]
> JavaScript error: http://cutroni.com/, line 0: postYear is not defined
> JavaScript error: , line 0: uncaught exception: [object Object]
> JavaScript error: http://d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/xa48ljrifk/analytics.min.js, line 2: too much recursion
> JavaScript error: , line 0: uncaught exception: [object Object]
> JavaScript error: http://cdn.mxpnl.com/libs/mixpanel-2.1.min.js, line 39: too much recursion

I don't think there's much to be done on the Firefox side here. I emailed the site owner (via http://cutroni.com/blog/contact/) and pointed him at this bug.
Flags: needinfo?(n.nethercote)
Summary: Memory leak → High CPU and memory usage on cutroni.com page due to repeated loading of scripts
I found another site http://www.naruto.com.br/index.php which seems to be worst than the previous, now instead of repeated reloading in a few seconds memory usage goes to 2GiB+. Unlike the cutroni.com, this new site doesn't eats up memory in other browsers (tested in IE 10 and chrome).
Attached file 2nd site about:memory
about:memory of http://www.naruto.com.br/index.php with 2GiB+ memory usage.
Hi Pedro. Can you please file the naruto.com problem in a separate bug report? It gets really confusing if multiple, distinct problems are described in a single bug report. Thanks!
Whiteboard: [MemShrink]
I will close this bug per comment 5
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Resolution: WORKSFORME → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: