Skip to content

RDKEMW-25420: Free SHM memory pages after pipeline teardown - #611

Open
skywojciechowskim wants to merge 1 commit into
masterfrom
feature/RDKEMW-25420
Open

skywojciechowskim wants to merge 1 commit into
masterfrom
feature/RDKEMW-25420

Conversation

@skywojciechowskim

Copy link
Copy Markdown
Contributor

RDKEMW-25420: Free SHM memory pages after pipeline teardown

Reason for change: Free SHM memory pages after pipeline teardown to save the memory
Test Procedure: Rialto CI

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

Copy link
Copy Markdown

Pull request title must follow the pattern:
< JIRA TICKET >: < one line summary of change less than 65 characters >

Pull request description must follow the Commit message format for RDK-E:
https://etwiki.sys.comcast.net/spaces/RDKAR/pages/1407997180/Commit+Message+Format+For+RDKE

  1. Associated JIRA ticket in format : < JIRA TICKET >: < one line summary of change less than 65 characters >
  2. Detailed reason for change information
  3. Test procedure. Only references links to Jira ticket or sub tickets where test steps and references are captured.

< JIRA TICKET >: < one line summary of change less than 65 characters >
< empty line >
Reason for change:
Test Procedure: < https://ccp.sys.comcast.net/browse/JIRA TICKET/url/to/test_step_section>

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 reclaim mechanism does not free memfd backing pages and mishandles unaligned web-audio partitions.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds shared-memory reclamation during pipeline teardown.

Changes:

  • Advises the kernel to discard a released partition’s pages.
File Description
media/​server/​main/​source/​SharedMemoryBuffer.cpp Attempts to reclaim partition memory during unmapping.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +232 to +234
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:
WARNING: Lines coverage decreased from: 84.7% to 84.6%
WARNING: Functions coverage decreased from: 93.0% to 92.8%

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