out of memory with big parts
See original GitHub issueSteps to Reproduce
working within big files that have big (or maybe multiple?) part
s makes editing laggy until AS runs out of memory, doesn’t seem to happen in VS Code.
some_class.dart
part 'some_class.d.dart';
changing it to :
import 'some_class_part.dart';
export 'some_class_part.dart';
instantly makes editing faster, no more lag or out of memory errors
I’m not the only one noticing it : https://stackoverflow.com/questions/64734912/android-studio-running-out-of-memory-while-editing-big-multipart-dart-files
Version info
[✓] Flutter (Channel unknown, 1.22.2, on Mac OS X 10.15.7 19H15, locale en-BE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 12.1) [✓] Chrome - develop for the web [!] Android Studio (version 4.1) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] VS Code (version 1.51.0)
[✓] Connected device (2 available)
! Error: Benoit’s iPhone is not connected. Xcode will continue when Benoit’s iPhone is connected. (code -13)
(happens as well on 1.22.2 stable)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:17 (11 by maintainers)
Top GitHub Comments
@benoitskipr it’s an option in the VS Code settings:
It’s off by default, so if you’re not aware of it you probably don’t have it enabled. In that case, VS Code would be caching
AvailableSuggestionSets
in its own process (although I’m not sure if there’s an easy way to get a memory dump to compare that to Android Studio).I took a quick look at the log posted by @benoitskipr. There are some questionable entries. None of these are weak references.
13: [45.3K/1.45MB] [45.3K/1.45MB] org.dartlang.analysis.server.protocol.Location 14: [45.3K/2.71MB] [45.3K/2.71MB] org.dartlang.analysis.server.protocol.Element The OP did say the files are big, so maybe 45K instances of Location and Element is not unexpected.
15: [45.1K/3.61MB] [45.1K/3.61MB] org.dartlang.analysis.server.protocol.AvailableSuggestion I don’t remember what AvailableSuggestion is used for but it sounds like something in the UI and should not need so many instances. OTOH, big files might have that many.
16: [40.4K/ 647KB] [40.4K/ 647KB] io.flutter.run.ObservatoryFile$Position OK, big files, but it is still a lot of Position instances.
21: [26.3K/ 632KB] [26.3K/ 632KB] com.intellij.openapi.actionSystem.impl.ActionUpdater$$Lambda$1701 34: [16.1K/ 258KB] [16.1K/ 258KB] com.intellij.openapi.actionSystem.Presentation$$Lambda$461 I’d like to understand why we need 26K lambdas for ActionUpdater and 16K for Presentation.
36: [13.2K/ 727KB] [13.2K/ 727KB] com.intellij.openapi.actionSystem.AnActionEvent Is 13K instances of AnActionEvent expected?
37: [13.2K/ 317KB] [13.2K/ 317KB] io.flutter.view.FlutterViewToggleableAction$$Lambda$6414 Another lambda-count that makes me wonder if something is not quite right.
@alexander-doroshko is my intuition accurate (these are too big) or do the instance counts look reasonable to you?