Read Request.body with StreamReader can cause Large object heap when reading request in middleware .net5

93 Views Asked by At

Hi I'm trying to read request inside middleware but I'm facing a strange behavior when reading the (Request.Body) with stream reader ! the problem is that its take a lot of memory for a single request (max 7Mb size ) in my visual studio memory profiler my memory usage rises about 800mb for no reason ! i think its a Large object Heap thing !

any ideas how to solve this strange behavior

0

There are 0 best solutions below