提交 7ab88375 编写于 作者: A Andrew Casey

Merge pull request #6870 from amcasey/OutputOOM

Mitigate OutOfMemory when clearing large output buffers
......@@ -281,6 +281,13 @@ public void ClearView()
// remove all the spans except our initial span from the projection buffer
_uncommittedInput = null;
// We remove all spans from the projection buffer *before* updating the
// subject buffers so that composite/merged changes to the projection
// buffer don't have to be computed. This seems to alleviate the problem
// we were having with OutOfMemoryExceptions when clearing large output
// buffers (which did not, themselves, trigger OOMs).
RemoveProjectionSpans(0, _projectionBuffer.CurrentSnapshot.SpanCount);
// Clear the projection and buffers last as this might trigger events that might access other state of the REPL window:
RemoveProtection(OutputBuffer, _outputProtection);
RemoveProtection(StandardInputBuffer, _standardInputProtection);
......@@ -301,8 +308,6 @@ public void ClearView()
edit.Apply();
}
RemoveProjectionSpans(0, _projectionBuffer.CurrentSnapshot.SpanCount);
// Insert an empty output buffer.
// We do it for two reasons:
// 1) When output is written to asynchronously we need a buffer to store it.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册