Free SHM memory pages after pipeline teardown - #612
skywojciechowskim wants to merge 3 commits into
Conversation
This reverts commit 2ce57b1.
|
Pull request must be merged with a description containing the required fields, Summary: If there is no jira releated to this change, please put 'Jira: NO-JIRA'. Description can be changed by editing the top comment on your pull request and making a new commit. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The advice does not free the shared backing pages, and it silently fails for unaligned web-audio slots.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
This fix aims to reclaim shared-memory pages when a media pipeline or web-audio player releases its partition.
Changes:
- Advises the partition’s memory range before marking the partition free.
| File | Description |
|---|---|
media/server/main/source/SharedMemoryBuffer.cpp |
Adds memory advice during partition teardown. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| { | ||
| const std::uint32_t kLength{partition->dataBufferVideoLen + partition->dataBufferAudioLen + | ||
| partition->dataBufferSubtitleLen}; | ||
| madvise(partitionDataPtr, kLength, MADV_DONTNEED); |
| { | ||
| const std::uint32_t kLength{partition->dataBufferVideoLen + partition->dataBufferAudioLen + | ||
| partition->dataBufferSubtitleLen}; | ||
| madvise(partitionDataPtr, kLength, MADV_DONTNEED); |
|
Coverage statistics of your commit: |


Summary: Free SHM memory pages after pipeline teardown
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-25420