Open Bug 1716579 Opened 3 years ago Updated 3 years ago

Reduce the memory usage of windows that haven't been rendered for a long time

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: nical, Assigned: nical)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

It could be done by sending a memory pressure event, or some other message to empty the caches and pools.

Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fb2f9cfe820d
Minimize memory usage of windows that haven't been rendered for a long time. r=gfx-reviewers,bradwerth

Backed out for causing valgrind bustage

[task 2021-06-17T16:08:07.042Z] 16:08:07     INFO -   4:29.53 --13093-- memcheck GC: 97392 nodes, 35915 survivors (36.9%)
[task 2021-06-17T16:08:07.829Z] 16:08:07     INFO -   4:30.31 ==13093== Thread 33 Renderer:
[task 2021-06-17T16:08:07.830Z] 16:08:07     INFO -   4:30.31 TEST-UNEXPECTED-FAIL | valgrind-test | Conditional jump or move depends on uninitialised value(s) at webrender::renderer::upload::upload_to_texture_cache / webrender::renderer::Renderer::update_texture_cache / wr_renderer_update / Update
[task 2021-06-17T16:08:07.830Z] 16:08:07     INFO -   4:30.31 ==13093== Conditional jump or move depends on uninitialised value(s)
[task 2021-06-17T16:08:07.830Z] 16:08:07     INFO -   4:30.31 ==13093==    at 0x162B49FF: webrender::renderer::upload::upload_to_texture_cache+10575 (mod.rs:2045)
[task 2021-06-17T16:08:07.830Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x162AA2D7: webrender::renderer::Renderer::update_texture_cache+5319 (mod.rs:2299)
[task 2021-06-17T16:08:07.830Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x162F4716: wr_renderer_update+14246 (mod.rs:1578)
[task 2021-06-17T16:08:07.831Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x11ED5216: Update (checkouts/gecko/gfx/webrender_bindings/RendererOGL.cpp:136)
[task 2021-06-17T16:08:07.831Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x11ED5216: mozilla::wr::RenderThread::UpdateAndRender(mozilla::wr::WrWindowId, mozilla::layers::BaseTransactionId<mozilla::VsyncIdType> const&, mozilla::TimeStamp const&, bool, mozilla::Maybe<mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> > const&, mozilla::Maybe<mozilla::wr::ImageFormat> const&, mozilla::Maybe<mozilla::Range<unsigned char> > const&, bool*)+630 (checkouts/gecko/gfx/webrender_bindings/RenderThread.cpp:490)
[task 2021-06-17T16:08:07.831Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x11ED4DFF: mozilla::wr::RenderThread::HandleFrameOneDoc(mozilla::wr::WrWindowId, bool)+687 (checkouts/gecko/gfx/webrender_bindings/RenderThread.cpp:340)
[task 2021-06-17T16:08:07.832Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x11EDB7FE: applyImpl<mozilla::wr::RenderThread, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool), StoreCopyPassByConstLRef<mozilla::wr::WrWindowId>, StoreCopyPassByConstLRef<bool> , 0, 1> (dist/include/nsThreadUtils.h:1150)
[task 2021-06-17T16:08:07.832Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x11EDB7FE: apply<mozilla::wr::RenderThread, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool)> (dist/include/nsThreadUtils.h:1156)
[task 2021-06-17T16:08:07.832Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x11EDB7FE: mozilla::detail::RunnableMethodImpl<mozilla::wr::RenderThread*, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool), true, (mozilla::RunnableKind)0, mozilla::wr::WrWindowId, bool>::Run()+46 (dist/include/nsThreadUtils.h:1203)
[task 2021-06-17T16:08:07.832Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DA69D: MessageLoop::RunTask(already_AddRefed<nsIRunnable>)+189 (checkouts/gecko/ipc/chromium/src/base/message_loop.cc:454)
[task 2021-06-17T16:08:07.833Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DB13B: DeferOrRunPendingTask (checkouts/gecko/ipc/chromium/src/base/message_loop.cc:463)
[task 2021-06-17T16:08:07.833Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DB13B: MessageLoop::DoWork()+923 (checkouts/gecko/ipc/chromium/src/base/message_loop.cc:538)
[task 2021-06-17T16:08:07.833Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DB790: base::MessagePumpDefault::Run(base::MessagePump::Delegate*)+288 (checkouts/gecko/ipc/chromium/src/base/message_pump_default.cc:35)
[task 2021-06-17T16:08:07.833Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DA4D5: RunInternal (checkouts/gecko/ipc/chromium/src/base/message_loop.cc:331)
[task 2021-06-17T16:08:07.833Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DA4D5: RunHandler (checkouts/gecko/ipc/chromium/src/base/message_loop.cc:324)
[task 2021-06-17T16:08:07.834Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115DA4D5: MessageLoop::Run()+85 (checkouts/gecko/ipc/chromium/src/base/message_loop.cc:306)
[task 2021-06-17T16:08:07.834Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115E4720: base::Thread::ThreadMain()+512 (checkouts/gecko/ipc/chromium/src/base/thread.cc:187)
[task 2021-06-17T16:08:07.834Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x115E0EB9: ThreadFunc(void*)+9 (checkouts/gecko/ipc/chromium/src/base/platform_thread_posix.cc:40)
[task 2021-06-17T16:08:07.834Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x4E3E063: start_thread+195 (pthread_create.c:309)
[task 2021-06-17T16:08:07.834Z] 16:08:07     INFO -   4:30.31 ==13093==    by 0x5B6162C: clone+108 (clone.S:111)
[task 2021-06-17T16:08:07.834Z] 16:08:07     INFO -   4:30.31 ==13093==  Uninitialised value was created by a stack allocation
[task 2021-06-17T16:08:07.835Z] 16:08:07     INFO -   4:30.31 ==13093==    at 0x162B20BD: webrender::renderer::upload::upload_to_texture_cache+13 (upload.rs:50)
[task 2021-06-17T16:08:07.835Z] 16:08:07     INFO -   4:30.31 ==13093==
[task 2021-06-17T16:08:07.835Z] 16:08:07     INFO -   4:30.31 {
[task 2021-06-17T16:08:07.835Z] 16:08:07     INFO -   4:30.31    <insert_a_suppression_name_here>
[task 2021-06-17T16:08:07.835Z] 16:08:07     INFO -   4:30.31    Memcheck:Cond
[task 2021-06-17T16:08:07.835Z] 16:08:07     INFO -   4:30.31    fun:_ZN9webrender8renderer6upload23upload_to_texture_cache17haea3ca3710205d4dE
[task 2021-06-17T16:08:07.836Z] 16:08:07     INFO -   4:30.31    fun:_ZN9webrender8renderer8Renderer20update_texture_cache17h31ef71a575071925E
[task 2021-06-17T16:08:07.836Z] 16:08:07     INFO -   4:30.31    fun:wr_renderer_update
[task 2021-06-17T16:08:07.836Z] 16:08:07     INFO -   4:30.31    fun:Update
[task 2021-06-17T16:08:07.836Z] 16:08:07     INFO -   4:30.31    fun:_ZN7mozilla2wr12RenderThread15UpdateAndRenderENS0_10WrWindowIdERKNS_6layers17BaseTransactionIdINS_11VsyncIdTypeEEERKNS_9TimeStampEbRKNS_5MaybeINS_3gfx12IntSizeTypedINSD_12UnknownUnitsEEEEERKNSC_INS0_11ImageFormatEEERKNSC_INS_5RangeIhEEEEPb
[task 2021-06-17T16:08:07.836Z] 16:08:07     INFO -   4:30.31    fun:_ZN7mozilla2wr12RenderThread17HandleFrameOneDocENS0_10WrWindowIdEb
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:applyImpl<mozilla::wr::RenderThread, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool), StoreCopyPassByConstLRef<mozilla::wr::WrWindowId>, StoreCopyPassByConstLRef<bool> , 0, 1>
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:apply<mozilla::wr::RenderThread, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool)>
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:_ZN7mozilla6detail18RunnableMethodImplIPNS_2wr12RenderThreadEMS3_FvNS2_10WrWindowIdEbELb1ELNS_12RunnableKindE0EJS5_bEE3RunEv
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:_ZN11MessageLoop7RunTaskE16already_AddRefedI11nsIRunnableE
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:DeferOrRunPendingTask
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:_ZN11MessageLoop6DoWorkEv
[task 2021-06-17T16:08:07.837Z] 16:08:07     INFO -   4:30.32    fun:_ZN4base18MessagePumpDefault3RunEPNS_11MessagePump8DelegateE
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:RunInternal
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:RunHandler
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:_ZN11MessageLoop3RunEv
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:_ZN4base6Thread10ThreadMainEv
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:_ZL10ThreadFuncPv
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:start_thread
[task 2021-06-17T16:08:07.838Z] 16:08:07     INFO -   4:30.32    fun:clone
[task 2021-06-17T16:08:07.839Z] 16:08:07     INFO -   4:30.32 }
Flags: needinfo?(nical.bugzilla)

Update: it has also caused btime failures.

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:nical, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(bwerth)
Flags: needinfo?(bwerth)

The valgrind failure is a false positive, still trying to figure out what is up with the browser time ones.

Flags: needinfo?(nical.bugzilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: