Skip to content

Cobalt Image Cache: Implement pre-allocated pool, logging, and statistics#10793

Draft
kjyoun wants to merge 1 commit into
youtube:mainfrom
kjyoun:image-cache-frag
Draft

Cobalt Image Cache: Implement pre-allocated pool, logging, and statistics#10793
kjyoun wants to merge 1 commit into
youtube:mainfrom
kjyoun:image-cache-frag

Conversation

@kjyoun
Copy link
Copy Markdown
Contributor

@kjyoun kjyoun commented Jun 7, 2026

  • Implemented ImageDecodeMemoryPool to manage a contiguous 32MB arena for image decodes, mitigating physical memory fragmentation.
  • Implemented PooledDiscardableMemory to allocate backing memory from the pool.
  • Integrated the pool into GpuImageDecodeCache::DecodeImageIfNecessary, controlled via the 'PreallocatedImageCachePool' base::Feature.
  • Added robust fallback to the default allocator if the pool runs out of memory.
  • Added detailed logs for SW/HW decodes and cache stats in 'MESSAGE: key=value' format.
  • Added explicit statistics tracking to ImageDecodeMemoryPool (allocations, failures) and integrated them into the periodic STATS log.

Issue: 1234

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 7, 2026

🤖 Gemini Suggested Commit Message


cobalt: Add pre-allocated image decode pool

Implement a 32MB pre-allocated arena for image decodes to mitigate
physical memory fragmentation. This pool is managed by the new
ImageDecodeMemoryPool and PooledDiscardableMemory classes.

The pool is integrated into GpuImageDecodeCache and controlled via the
PreallocatedImageCachePool feature flag. This change also introduces
detailed logging for software and hardware decodes, along with periodic
statistics tracking for allocation success and failure rates to improve
observability.

Issue: 1234

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@kjyoun kjyoun force-pushed the image-cache-frag branch 2 times, most recently from 0ee367d to a4f191a Compare June 7, 2026 21:30
…tics

- Implemented ImageDecodeMemoryPool to manage a contiguous 32MB arena for image decodes, mitigating physical memory fragmentation.
- Implemented PooledDiscardableMemory to allocate backing memory from the pool.
- Integrated the pool into GpuImageDecodeCache::DecodeImageIfNecessary, controlled via the 'PreallocatedImageCachePool' base::Feature.
- Added robust fallback to the default allocator if the pool runs out of memory.
- Added detailed logs for SW/HW decodes and cache stats in 'MESSAGE: key=value' format.
- Added explicit statistics tracking to ImageDecodeMemoryPool (allocations, failures) and integrated them into the periodic STATS log.

TAG=agy
CONV=d68ce74a-a9b1-496e-b926-4a5d9c9fdc14
@kjyoun kjyoun force-pushed the image-cache-frag branch from a4f191a to af24958 Compare June 7, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant