Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed #227

Open
newsgrep opened this issue Sep 4, 2024 · 2 comments
Open
Labels
ack acknowledged

Comments

@newsgrep
Copy link

newsgrep commented Sep 4, 2024

I useed Linux native with npm 10.8.3 node 22.8.0. And also Docker with node:18-alpine and node:20-alpine and I have > 14GB RAM free. I always get the same error, any hints how to processed?:

$ sudo npm install -g @commerce-apps/[email protected]; node --trace-deprecation /usr/local/bin/raml-toolkit diff --log-level=debug /tmp/old.raml /tmp/new -f console

npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Sparqlee has been moved to @comunica/expression-evaluator

changed 478 packages in 8s

30 packages are looking for funding
  run `npm fund` for details
(node:14358) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:108:7)
    at Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/@commerce-apps/raml-toolkit/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
Finding differences between flattened JSON-LD of /tmp/old.raml and /tmp/new.raml
Added plugin to include node ID in the node delta: addNodeInfo,collectChildren,trivial,dates,texts,objects,arrays

<--- Last few GCs --->

[14358:0x35958000]    19360 ms: Mark-Compact 2002.3 (2095.4) -> 2000.4 (2095.7) MB, pooled: 1 MB, 246.40 / 0.00 ms  (average mu = 0.075, current mu = 0.005) allocation failure; scavenge might not succeed
[14358:0x35958000]    19597 ms: Mark-Compact 2001.0 (2095.9) -> 2000.6 (2095.4) MB, pooled: 2 MB, 237.03 / 0.00 ms  (average mu = 0.039, current mu = 0.001) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xe35ec2 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
 2: 0x124f9c0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 3: 0x124fc97 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0x147f4d5  [node]
 5: 0x147f503  [node]
 6: 0x14985ba  [node]
 7: 0x149b788  [node]
 8: 0x1e340b1  [node]
@joeluong-sfcc
Copy link
Collaborator

Hey @newsgrep, thanks for creating this issue. Does this issue happen outside a docker environment? When you say you have 14 GB of RAM free, does that mean for your machine or the memory you've allocated for your docker container? I'm not sure what the issue is but here's a few things you can try:

  1. clear cache: npm cache clean --force
  2. use a different version of node
  3. Increase maximum memory for docker with the --memory flag
  4. Increase memory for node with the --max-old-space-size flag: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes

Let me know if this doesn't resolve the issue, I can create a ticket in our backlog for this work.

@joeluong-sfcc joeluong-sfcc added the ack acknowledged label Oct 18, 2024
@newsgrep
Copy link
Author

Thank you for your response.

  1. Did not help
  2. Used 20 and 22 which Version shall I try?
  3. I mean the RAM on my mashine, it also happend when I run node natively without docker.
  4. Did not help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack acknowledged
Projects
None yet
Development

No branches or pull requests

2 participants