Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.OutOfMemoryException: at System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1.Rent #9737

Closed
stephenschwan opened this issue Feb 14, 2018 · 6 comments
Labels
area-GC-coreclr tenet-performance Performance related issue
Milestone

Comments

@stephenschwan
Copy link

Unfortunately I was unable to get a dump of the process before the app service was restarted, but we have never encountered this before. No rhyme or reason - there was no memory pressure on the servers (web app - s3). I have attached the stack trace - though i don't think it will provide much.

Though the bigger question is, if this happens again, what should I trace or collect such that we have enough info.

thanks,
stephen
outofmemstacktrace.txt

@RussKeldorph
Copy link
Contributor

@benaadams Is your comment on dotnet/corefx#27185 implying you have a way to consistently reproduce this?

@benaadams
Copy link
Member

benaadams commented Feb 22, 2018

No, a way to not use the ArrayPool for HttpResponseStreamWriter which it where the call stack is throwing

System.OutOfMemoryException:
   at System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1.Rent
   at Microsoft.AspNetCore.WebUtilities.HttpResponseStreamWriter..ctor
   at Microsoft.AspNetCore.Mvc.Internal.MemoryPoolHttpResponseStreamWriterFactory.CreateWriter
   at Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter+<WriteResponseBodyAsync>d__11.MoveNext

More specifically outlined in the use case of this api request https://github.com/dotnet/corefx/issues/27268

The HttpResponseStreamWriter holds onto the arrays for lifetime of writing/request so long running/blocked requests would cause increased ArrayPool usage; however I'm not sure why it would OOM though as the numbers returned to the pool are capped; so it shouldn't cause a greater issue than allocating fresh.

Related issue of the ArrayPool consuming available memory https://github.com/dotnet/corefx/issues/25841

@RussKeldorph
Copy link
Contributor

Ok thanks for the clarification.

@RussKeldorph
Copy link
Contributor

@jkotas Does this appear actionable? If so, could you help triage it? If not, please close.

@jkotas
Copy link
Member

jkotas commented Mar 18, 2018

@Maoni0
Copy link
Member

Maoni0 commented Apr 5, 2018

yes, all these should be dups of https://github.com/dotnet/corefx/issues/25841. GC just provides an API to indicate what memory situation we are in; it's really up to the pool implementation to decide on trimming.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-GC-coreclr tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

6 participants