[Bug]: Memory leak when calling native function repeatedly

オープン
#7,883 コメント 2 件 リアクション 2 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@theproducer がすでに取り組んでいます。

2025年2月20日 から。

評価

この issue はまだ評価されていません。

説明

platform: ios type: bug
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

主要言語
TypeScript
スター
17.1k
フォーク
1.3k
平均マージ
1日 22時間
マージ済み PR(30日)
26

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/capacitor のほかの issue

ionic-team/capacitor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。