Skip to content

LOH in StreamCopier #151

Closed
Closed
@Kahbazi

Description

@Kahbazi

Why is the buffer size is 81920 in StreamCopier?

https://github.com/microsoft/reverse-proxy/blob/ca46305dc23519598d831c0fca64e0136476c89b/src/ReverseProxy.Core/Service/Proxy/StreamCopier.cs#L19

Is it to avoid having Large Heap Object? If so I think it still creates a LOH since ArrayPool<byte>.Shared is creating arrays with the length of power of 2, and Renting with length of 81920 would get a array with size of 131072.
Or is it ok to have pooled LOH with ArrayPool?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions