Closed Bug 1524297 Opened 5 years ago Closed 5 years ago

Combine flexbox and box model highlighter is causing huge memory usage

Categories

(DevTools :: Inspector: Layout, defect, P2)

67 Branch
defect

Tracking

(firefox66 unaffected, firefox67+ wontfix)

RESOLVED WONTFIX
Tracking Status
firefox66 --- unaffected
firefox67 + wontfix

People

(Reporter: jevus.d, Assigned: miker)

References

(Blocks 1 open bug)

Details

(Keywords: regression, Whiteboard: [MemShrink:P2])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

Using nightly 67.0a1 (2019-01-31) (64-bit)

Load page with 1200 list items in a div.
Open developer tools.
Move mouse across the divs and lists.
Firefox highlights the boxes pink and then freezes.
Memory of tab increases and doesn't stop.

Actual results:

Tab went up to about 8GB of memory usage and then I closed it by killing the process in task manager.

Expected results:

It should not have frozen the developer tools.

This bug happened after updating nightly yesterday.
Before the update the developer tools had no issues with handling 1000s of div list items.
Before that update the tools also did not have the pink box highlighting.

After the update and with the introduction of the pink highlighting is when the developer tools started freezing.

Here is a video of the tools freezing. https://streamable.com/hiqug

Build ID 20190131093752
User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

I was not able to reproduce this, Can you give me the link to the website if it's accessible to the public.
Thank you.

Component: Untriaged → Memory
Product: Firefox → DevTools

From the bug description it looks like the reporter was working with the Inspector, not the Memory tool. => moving to the appropriate component.

Component: Memory → Inspector
Whiteboard: [MemShrink] → [MemShrink:P2]

Andrei, can someone from your team try and find the regression window? Looks like a recent issue in 67. Thanks!

Flags: needinfo?(andrei.vaida)

(In reply to Damira Akh from comment #3)

Build ID 20190131093752
User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0

I was not able to reproduce this, Can you give me the link to the website if it's accessible to the public.
Thank you.

Hi Damira,

It's an internal site. I tried to strip the identifying information and I've attached the HTML.

Note: the javascript that loaded the 1200 divs did not insert new lines after each list item div.
I added a new line for each generated div and that seemed to help a bit - the memory footprint still grows larger and larger but instead of the site being totally unresponsive it now has a 1-2 second lag while highlighting the elements in the developer tools.

If you want to replicate the original issue then you'd need to strip the new lines dividing the 1200 list item divs and make it into one giant line.

Attached file test page.html

This html file has the 1200 list item divs separated by a new line.
The original did not have new lines - it was all one giant line of 1200 list items

To replicate, open dev tools and inspect the list item container so the list items are visible.
Then just move your mouse back and forth over a few lines and watch the memory usage go up.

Thank you for the bug report. I was also able to reproduce this on mac. This seems to be caused by the combined flexbox + box model higlighters.

@jevus.d, a quick fix for your local development using nightly would be to go to "about:config" and toggle off "devtools.inspector.flexboxHighlighter.combine". We are currently testing a combine flexbox + box model highlighter in nightly only which is why you are experiencing the issue, and your test case has been super useful so extra thanks for that.

Clearing the needinfo for a regression window since I have been able to replicate the issue and figure out the cause.

Flags: needinfo?(andrei.vaida)
Summary: Developer tools memory leak → Combine flexbox and box model highlighter is causing huge memory usage
Component: Inspector → Inspector: Layout

This isn't fixed with Brad's method but changing devtools.inspector.flexboxHighlighter.combine to false gives us our highlighter performance back.

I'm not sure why performance is so terrible on that particular page but I will look into it.

Assignee: nobody → mratcliffe
Status: UNCONFIRMED → NEW
Ever confirmed: true
Has STR: --- → yes
OS: Unspecified → All
Priority: -- → P2
Hardware: Unspecified → All
Status: NEW → ASSIGNED

Since landing bug 1523335 the memory usage appears to be much better but the highlighter is still slow due to drawing so much information on a canvas.

When bug 1527282 lands, which gives a slight improvement we should test this again.

The feature that consumes the memory is only enabled in nightly and dev-edition right now. So this problem will not reach the release audience.
The feature has, so far, received mixed signals. So we are not going to let it ride the trains as is any time soon.
It is likely that we either remove it, or rework it in a way that the memory characteristics will be very different.
So, no need to track firefox-67 here.

We are removing the feature in bug 1536096, so no need to fix this memory consumption problem.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: