Garbage collection of strings returned from C # method calls on ascx pages

For a web application developed on ASP.NET, we find that for user control files (ascx) we return long strings as a result of method calls. They are embedded in ascx pages using special tags.<% %>

When we perform a memory dump analysis for an application, we find that many of these lines are not garbage collected. In addition, ascx pages are compiled into temporary DLLs and stored in memory. Is this the reason that long lines remain in memory rather than garbage collection?

Note. Lines larger than 85 KB.

+3
source share
2 answers

, , , . . , .

, CompilationRelaxations NoStringInterning.

Intern System.String Performance

+2

, . , Tess Ferrandez. ,

GC.Collect(3)
GC.WaitForPendingFinalizers()
GC.Collect(3)

, .

+2

Source: https://habr.com/ru/post/1737517/


All Articles