diff --git a/platform/util/src/com/intellij/util/concurrency/propagation.kt b/platform/util/src/com/intellij/util/concurrency/propagation.kt index 21e82070d4d6..62e1aee65f9e 100644 --- a/platform/util/src/com/intellij/util/concurrency/propagation.kt +++ b/platform/util/src/com/intellij/util/concurrency/propagation.kt @@ -268,6 +268,7 @@ internal fun capturePropagationContext(r: Runnable, forceUseContextJob : Boolean } val (childContext, childContinuation) = if (forceUseContextJob) createChildContextWithContextJob(r.toString()) + //TODO: do we really need .toString() here? It allocates ~6 Gb during indexing else createChildContext(r.toString()) command = ContextRunnable(true, childContext, command) if (childContinuation != null) { diff --git a/platform/util/storages/src/com/intellij/platform/util/io/storages/DataExternalizerEx.java b/platform/util/storages/src/com/intellij/platform/util/io/storages/DataExternalizerEx.java index df53f0c4c6fe..7c4bcad6bdc0 100644 --- a/platform/util/storages/src/com/intellij/platform/util/io/storages/DataExternalizerEx.java +++ b/platform/util/storages/src/com/intellij/platform/util/io/storages/DataExternalizerEx.java @@ -117,6 +117,14 @@ public interface DataExternalizerEx { return new ByteArrayWriter(bytes, 0, bytes.length); } + static KnownSizeRecordWriter fromBytes(@NotNull ByteArraySequence bytes) { + return new ByteArrayWriter( + bytes.getInternalBuffer(), + bytes.getOffset(), + bytes.getLength() + ); + } + static KnownSizeRecordWriter fromBytes(byte @NotNull [] bytes, int offset, int length) { @@ -161,7 +169,7 @@ public interface DataExternalizerEx { @Override public String toString() { - return "ByteArrayWriter[" + IOUtil.toHexString(Arrays.copyOfRange(bytes, startingOffset, startingOffset+length)) + "]"; + return "ByteArrayWriter[" + IOUtil.toHexString(Arrays.copyOfRange(bytes, startingOffset, startingOffset + length)) + "]"; } } }