GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.17k stars 9.34k forks source link

High memory consumption from trace engine #16111

Open mattzeunert opened 1 month ago

mattzeunert commented 1 month ago

FAQ

URL

No shareable repro

What happened?

Node ran out of memory when running Lighthouse.

The memory profiler shows that invalidationsForEvent uses 328 MB.

Screenshot 2024-07-11 at 22 44 16

The invalidationsForEvent map has around 900 entries, but some of them have 10,000 or so SyntheticInvalidation events.

Screenshot 2024-07-11 at 22 43 58

What did you expect?

Lighthouse should run without crashing the Node process.

What have you tried?

No response

How were you running Lighthouse?

node

Lighthouse Version

12.1.0

Chrome Version

No response

Node Version

No response

OS

No response

Relevant log output

No response

adamraine commented 1 month ago

I think your assessment is correct. Invalidation events are extremely noisy and have led to problems in the past like https://github.com/GoogleChrome/lighthouse/issues/15869.

The invalidationsForEvent object is in a part of the trace engine Lighthouse doesn't use so we should consider turning it off somehow if we can't optimize the memory usage.

jackfranklin commented 1 month ago

Hey @mattzeunert thanks for the report. Is it possible for you to share the website you were using that caused this high memory? Just to aid our debugging. I absolutely understand if it's private and you are unable to though. Thanks!