flutter / flutter/devtools

debugger causes memory leaks in the debugged program

オープン
#9,301 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
P2 screen: debugger
主要言語
Dart
スター
1.7k
フォーク
404
平均マージ
6日 17時間
マージ済み PR(30日)
18

説明

```dart
import "dart:developer";
import "dart:typed_data";

@pragma("vm:never-inline")
foo(var x) {
debugger();
print(x.length);
}

main() {
for (;;) foo(new Uint8List(1 << 20));
}
```

Run the program and repeatedly press "Continue" in the debugger. Notice that the memory usage continues to grow. Without the debugger, memory quickly plateaus. (The effect is clearer with --no-concurrent-mark so the growth policy arrives at a lower level for this very high allocation rate.)

The debugger is probably retaining object ids long after the objects in question are no longer visible in the UI. Presumably this is because the debugger is sloppily using a single id zone for everything that is never discarded, instead of using a zone per refresh of the stack. (Which would predict this eventually plateaus at ~8 GB, the size of the array times the default object id ring size.)

This interfered with a user trying to debug a memory leak in https://github.com/dart-lang/sdk/issues/61036.

コントリビューションガイド

コントリビューションガイドを開く

評価

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

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

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