Skip to content

Free SHM memory pages after pipeline teardown - #612

Open
skywojciechowskim wants to merge 3 commits into
release/v0.15.2from
ShmFreeAfterPipelineTeardown
Open

skywojciechowskim wants to merge 3 commits into
release/v0.15.2from
ShmFreeAfterPipelineTeardown

Conversation

@skywojciechowskim

Copy link
Copy Markdown
Contributor

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

Copilot AI balanced review requested due to automatic review settings September 30, 2026 10:51
@github-actions

Copy link
Copy Markdown

Pull request must be merged with a description containing the required fields,

Summary:
Type: Feature/Fix/Cleanup
Test Plan:
Jira:

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 1 Medium severity

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);
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 0.0% to 84.4%
Congratulations, your commit improved functions coverage from: 0.0% to 92.5%

This branch has not been deployed

No deployments
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.

2 participants