Skip to content

dart2js retains large buffers after loading binary files in final stage #44478

Open
@rakudrama

Description

@rakudrama

This is the final state of modular dart2js with two code shards.
The files are m.dill, m.dill.data, m.code0 and m.code1.
The buffers are 1.7GB out of a total heap of ~10GB.
This is just before printing sizes.

Class CompilerSourceFileProvider
Shallow size 48B
Reachable size...↺
Retained size...↺
Retaining path{  ⊞  }
Inbound references{  ⊞  }
fields (5){  ⊟  
  bool isWindows false
  Uri cwd_Uri {  ⊞  }
  Map<Uri, Input<dynamic>> utf8SourceFiles _InternalLinkedHashMap (1) {  ⊞  }
  Map<Uri, Input<dynamic>> binarySourceFiles _InternalLinkedHashMap (4) {  ⊟  
    [ _Uri {  ⊞  } ] : Binary {  ⊟  
      final Uri uri = _Uri {  ⊞  }
      final List<int> data = _Uint8List (776370600) {  ⊞  }
    }
    [ _SimpleUri {  ⊞  } ] : Binary {  ⊟  
      final Uri uri = _SimpleUri {  ⊞  }
      final List<int> data = _Uint8List (314383771) {  ⊞  }
    }
    [ _SimpleUri {  ⊞  } ] : Binary {  ⊟  
      final Uri uri = _SimpleUri {  ⊞  }
      final List<int> data = _Uint8List (300354678) {  ⊞  }
    }
    [ _SimpleUri {  ⊞  } ] : Binary {  ⊟  
      final Uri uri = _SimpleUri {  ⊞  }
      final List<int> data = _Uint8List (305224933) {  ⊞  }
    }
  }
  int dartCharactersRead 1696348718
}

/cc @johnniwinther
I wonder if the Kernel deserialization could be made to work on a stream or list of blocks, so consumed bytes can be discarded, and lazy-parsed regions block-copied to smaller buffers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions