Skip to content
Snippets Groups Projects

vulkan/malloc: switch to wall clock garbage collection

Closed Niklas Haas requested to merge haasn/libplacebo:wallclock_gc into master

Instead of counting the number of vk_malloc_garbage_collect calls, which can vary wildly (e.g. being incremented on every pl_gpu_flush), use a real wall clock estimate.

The default expiry time of 100 ms is probably fine, it leaves plenty of headroom for typical video playback (which should surely exceed 10 fps!).

Merge request reports

Pipeline #375977 passed

Pipeline passed for fd0a7588 on haasn:wallclock_gc

Test coverage 79.97% (0.01%) from 1 job

Closed by Niklas HaasNiklas Haas 1 year ago (Aug 21, 2023 10:25am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Maintainer

    So, I'm not very happy with this approach either, for a multitude of reasons. Not only is 100ms too short in practice (longer than time to seek, usually), but increasing limit would also be bad: consider use in offline encoding scenario where we can hit thousands of fps, if e.g. frame size changes with every frame then we can persist hundreds or thousands of stale allocations.

    I think it's best to stick with a number-of-GC-calls derived age for this reason. But maybe we can do something smarter to avoid double-incrementing age when just calling pl_gpu_flush() right before submit_frame()?

  • closed

Please register or sign in to reply
Loading