Avoid retaining all protobuf objects in DeserializedMemberScope

Object model for deserialized protobuf isn't very cheap, so
loading just our stdlib's packages several times (as we do in the IDE)
might lead to ~ 96 MB of retained memory just by these objects.

While in fact many of them remain unused

 #KT-21517 Fixed
This commit is contained in:
Denis Zharkov
2018-01-17 12:14:28 +03:00
parent b701117ffb
commit 2e933a165a
9 changed files with 82 additions and 49 deletions
@@ -73,7 +73,8 @@ fun createKotlinJavascriptPackageFragmentProvider(
emptyList(),
notFoundClasses,
ContractDeserializerImpl(configuration),
platformDependentDeclarationFilter = PlatformDependentDeclarationFilter.NoPlatformDependent
platformDependentDeclarationFilter = PlatformDependentDeclarationFilter.NoPlatformDependent,
extensionRegistryLite = JsSerializerProtocol.extensionRegistry
)
for (packageFragment in packageFragments.filterIsInstance<KotlinJavascriptPackageFragment>()) {