After recent changes 'jar' tasks in some projects were disabled.
I've also added to search in 'result' (kotlin-reflect) and 'shadowJar'
tasks for manifest.
- Remove soft references that are too old.
- Compute memory usage based on Runtime.totalMemory() instead of
Runtime.maxMemory() as the latter is not reliable.
- Remove debug logs that haven't proved to be useful.
- Collect metrics on the number of cache hits (in addition to cache
misses).
#KT-52329 In Progress
[New IC] Reduce memory usage of classpath snapshot cache
Use object interning for commonly shared objects. These include:
- supertypes of classes
- package names of classes
One experiment showed that with the above optimization, memory usage was
reduced from 660 MB down to 280 MB (+ 4 MB for the interning pool).
More aggressive object interning didn't reduce memory usage much
further, but would increase interning overhead and code complexity, so
we didn't do this to more objects.
Note that this commit optimizes the size of classpath snapshots in
memory, not their serialized data on disk. (I attempted the latter,
but the size was only reduced from 160 MB down to 130 MB, while the code
complexity became much higher as multiple interning pools would need to
be stored to disk and later loaded from disk, each per classpath entry
snapshot or shrunk classpath snapshot.)
#KT-52329 Fixed
The problem comes from "com.gradle.plugin-publish" plugin. It asks to
run 'jar' task even if this tasks outputs are removed from artifacts.
As 'jar' and shadow 'embeddedJar' tasks outputs has the same name and
'jar' task runs after shadow one - this leads to jar file overwrite.
And eventually publishing unshadowed artifact.
This patch adds a binary compiler argument to allow not crashing if a
suspend function is called from a non-Main dispatcher from ObjC or
Swift. This is relevant for people using the new memory model, in which
this restriction may be relaxed.
The tests for this change will be committed to intellij repository
when it switches to the next Kotlin compiler containing the fix.
^KTIJ-21665
^KT-47159
This fixes error:
Project :kotlin-daemon-embeddable declares a dependency from
configuration 'compilerDummyJar' to configuration 'compilerDummyJar'
which is not declared in the descriptor for
project :kotlin-compiler-embeddable.
This exception is happening on build configuration trying to remove
default jar task artifacts from published one. I've set 'jar' task
to be always disabled instead and just add shadow jar to artifacts.
This plugin should do project common configuration in the Kotlin repo.
As a first thing I moved gson version constraint into it, because
current approach has Gradle bug:
https://github.com/gradle/gradle/issues/20548