{"record":{"id":"b8483fc11cbbdc14","repo":"nodejs/node","slug":"u-memory-allocation-error-b8483f","errorCode":"U_MEMORY_ALLOCATION_ERROR","errorMessage":"icupkg: not enough memory\\n","messagePattern":"icupkg: not enough memory\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"deps/icu-small/source/tools/toolutil/pkg_icu.cpp","lineNumber":72,"sourceCode":" * (in the system/ invariant charset).\n * If the listname ends with \".dat\", then read the ICU .dat package file.\n * Otherwise, read the file itself as a single-item list.\n */\nU_CAPI Package * U_EXPORT2\nreadList(const char *filesPath, const char *listname, UBool readContents, Package *listPkgIn) {\n    Package *listPkg = listPkgIn;\n    FILE *file;\n    const char *listNameEnd;\n\n    if(listname==nullptr || listname[0]==0) {\n        fprintf(stderr, \"missing list file\\n\");\n        return nullptr;\n    }\n\n    if (listPkg == nullptr) {\n        listPkg=new Package();\n        if(listPkg==nullptr) {\n            fprintf(stderr, \"icupkg: not enough memory\\n\");\n            exit(U_MEMORY_ALLOCATION_ERROR);\n        }\n    }\n\n    listNameEnd=strchr(listname, 0);\n    if(isListTextFile(listname)) {\n        // read the list file\n        char line[1024];\n        char *end;\n        const char *start;\n\n        file=fopen(listname, \"r\");\n        if(file==nullptr) {\n            fprintf(stderr, \"icupkg: unable to open list file \\\"%s\\\"\\n\", listname);\n            delete listPkg;\n            exit(U_FILE_ACCESS_ERROR);\n        }\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_icu.cpp#L54-L90","documentation":"readList does `new Package()` and checks for NULL to detect allocation failure, printing 'icupkg: not enough memory' and exit(U_MEMORY_ALLOCATION_ERROR). In practice standard C++ new throws std::bad_alloc rather than returning NULL, so this branch is essentially unreachable unless operator new is non-throwing.","triggerScenarios":"Severe memory exhaustion at the moment readList constructs its Package; or a build configured with nothrow new. The check `if(listPkg==nullptr)` after `new Package()` is the trigger.","commonSituations":"A memory-constrained container/CI hitting OOM while packaging; extremely rarely under normal new semantics. More likely indicates the process was already near the memory ceiling.","solutions":["Raise the available memory for the build (ulimit -v, container/cgroup limit, swap).","Reduce concurrent build parallelism so fewer large processes run at once (-j1).","Check for a genuine memory leak or runaway in the build with a smaller repro.","Add swap or move the build to a host with more RAM."],"exampleFix":"# before\n( ulimit -v 524288; icupkg ... )   # OOM -> exit 973\n# after\nulimit -v unlimited; icupkg ...","handlingStrategy":"validation","validationCode":"# ensure adequate memory before running icupkg\nulimit -v unlimited 2>/dev/null || true\ntest \"$(awk '/MemAvailable/ {print $2}' /proc/meminfo 2>/dev/null)\" -gt 524288 || echo \"low memory warning\" >&2","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Raise the memory ceiling (ulimit/cgroup/swap) for the build.","Reduce build parallelism (-j1) to cut peak memory.","Remember standard C++ new throws, so this branch is rarely the real failure — look for a broader OOM.","Move the build to a host with more RAM if it recurs."],"tags":["icu","icupkg","memory","build-tools"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}