Skip to content

Native memory consumption of ASP.net core application #29521

Answered by Danielku15
Danielku15 asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to improve the memory consumption to a reasonable level. To fully answer my initial question:

The main memory consumption is coming from the Razor file compilation. We were not using any precompiled views befoer which caused Roslyn to load a lot of things and perform a lot of tasks which caused the load. It is unclear why this is detected as Native Memory, but it could be related to some dynamic PE file generation and loading happening there.

To reduce the consumption without losing the possibility to dynamically change Razor templates following things needed to be changed:

  1. According to https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-2.2…

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
3 replies
@jkotas
Comment options

jkotas Jan 22, 2021
Collaborator

@Danielku15
Comment options

@jkotas
Comment options

jkotas Jan 25, 2021
Collaborator

Comment options

You must be logged in to vote
2 replies
@jkotas
Comment options

jkotas Jan 25, 2021
Collaborator

@Danielku15
Comment options

Comment options

You must be logged in to vote
2 replies
@davidfowl
Comment options

@Danielku15
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@davidfowl
Comment options

Answer selected by Danielku15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants