Fix OOM in R2RDump (#32274)
authorAnton Lapounov <antonl@microsoft.com>
Fri, 14 Feb 2020 19:13:56 +0000 (11:13 -0800)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 19:13:56 +0000 (11:13 -0800)
commit5ffe8827ecc61502952c2f050811c17f8545f0a5
tree9c2cbcaa552d6842bf0215651cba5d04100c9d14
parent860fe5cba3371e99af082cb4b14c20e9ac370cc6
Fix OOM in R2RDump (#32274)

R2RDump allocated a new copy of the System.Private.CoreLib assembly for each method of every generic type defined in the same image. As a result, it died due to OOM when dumping big images, e.g., System.Private.CoreLib itself. Also, in case of a non-composite R2R image, a wrong metadata reader was used for methods of generic types defined in the same image. Both issues were introduced in #32027.
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs