Skip to content

[$500] [Due for payment 2025-12-03] react-native-performance memory leak patch on Android #72343

@mateuuszzzzz

Description

@mateuuszzzzz

If you haven't already, check out our contributing guidelines and patch guidelines for information on how to manage patches.


Patch Information

Library Name: react-native-performance
Library Version: 5.1.4
Patch Number: 002
Patch Description: fix-listeners-memory-leak
Full Patch Filename: react-native-performance+5.1.4+002+fix-listeners-memory-leak.patch

Patch Details

Reason for Patch

This patch is part of memory leak audit.
react-native-performance has a memory leak where ReactMarker listeners are not properly removed when the module is destroyed. Additionally, setupListener can be called multiple times when getPackages is called multiple times, causing duplicate listeners.

Changes Made

This PR mainly improves how listeners are added and removed. It also extracts lambdas into constants so that they can be consistently referenced when calling addListener and removeListener, preventing duplicate listeners and ensuring that listeners can be properly removed.

Upstream Status

Upstream PR/Issue: oblador/react-native-performance#118

Related Information

PR Introducing Patch: #72341

Additional Notes

This fix isn’t specific to our HybridApp setup, these issues can occur in any bare React Native or brownfield app on Android.

Checklist

  • Patch file is correctly named and placed in the appropriate directory
  • Patch is documented in the corresponding details.md file
  • This issue is linked in the details.md file
  • Upstream PR/issue has been created (if applicable)
Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022001042913833799711
  • Upwork Job ID: 2001042913833799711
  • Last Price Increase: 2025-12-16

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions