Skip to content

[Bug]: Memory leak when calling native function repeatedly #7883

@vojto

Description

@vojto

Capacitor Version

💊   Capacitor Doctor  💊

Latest Dependencies:

  @capacitor/cli: 7.0.1
  @capacitor/core: 7.0.1
  @capacitor/android: 7.0.1
  @capacitor/ios: 7.0.1

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 7.0.1
  @capacitor/core: 7.0.1
  @capacitor/ios: 7.0.1

[success] iOS looking great! 👌

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

  1. Create a simple plugin with promise-returning function.
  2. Implement it on iOS side - make it return a 10mb string
  3. Call this function multiple times from JS

If you run this on device, the Safari inspector will report memory being allocated for every call and never garbage collected.

Image

Expected Behavior

Memory should be garbage collected after each call.

Project Reproduction

https://github.com/vojto/dbtest

Additional Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions