{"record":{"id":"abd895871d490afa","repo":"dotnet/runtime","slug":"out-of-memory-abd895","errorCode":null,"errorMessage":"\nOut of memory!\n","messagePattern":"\nOut of memory!\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/ilasm/asmtemplates.h","lineNumber":104,"sourceCode":"\t\t\t\tif(m_ulOffset)\n\t\t\t\t{\n\t\t\t\t\tmemcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));\n\t\t\t\t\tm_ulOffset = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n                    m_ulArrLen = GrowBuffer(m_ulArrLen);\n\t\t\t\t\tT** tmp = new T*[m_ulArrLen];\n\t\t\t\t\tif(tmp)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(m_Arr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmemcpy(tmp,m_Arr,m_ulCount*sizeof(T*));\n\t\t\t\t\t\t\tdelete [] m_Arr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tm_Arr = tmp;\n\t\t\t\t\t}\n\t\t\t\t\telse fprintf(stderr,\"\\nOut of memory!\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tm_Arr[m_ulOffset+m_ulCount] = item;\n\t\t\tm_ulCount++;\n\t\t}\n    };\n    ULONG COUNT() { return m_ulCount; };\n    T* POP()\n    {\n        T* ret = NULL;\n        if(m_ulCount)\n        {\n            ret = m_Arr[m_ulOffset++];\n            m_ulCount--;\n        }\n        return ret;\n    };\n    T* PEEK(ULONG idx) { return (idx < m_ulCount) ? m_Arr[m_ulOffset+idx] : NULL; };","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/ilasm/asmtemplates.h#L86-L122","documentation":"Printed at src/coreclr/ilasm/asmtemplates.h:104 inside the Stack<T>::PUSH template when the growing array allocation fails. The container cannot enlarge its backing store, so the new element is silently dropped.","triggerScenarios":"Triggered when `new T*[m_ulArrLen]` returns NULL during Stack growth (GrowBuffer returns a larger size but the heap refuses it).","commonSituations":"Assembling IL with a very deep/long stack of items (labels, locals), or running under tight memory limits.","solutions":["Increase available memory for ilasm.","Reduce the complexity/size of the IL being assembled.","Use a 64-bit ilasm binary.","Check for upstream memory leaks that exhaust the heap first."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// No public API; users cannot pre-validate template internals.\n// Mitigate by sizing the host: run a 64-bit ilasm with raised ulimits.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 64-bit ilasm for large IL inputs.","Reduce stack depth / label count in the source IL.","Investigate leaks upstream in the assembler."],"tags":["coreclr","ilasm","out-of-memory","allocation","template"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}