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

Memory Leak when using ng #17022

Closed
eau-de-la-seine opened this issue Feb 19, 2020 · 5 comments
Closed

Memory Leak when using ng #17022

eau-de-la-seine opened this issue Feb 19, 2020 · 5 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@eau-de-la-seine
Copy link

Hi,

There's a memory leak with ng, it keeps consuming memory despite memory increase, I've monitored and it has already consumed more than 17 GB of RAM! I think the problem is related to SASS because the program is stucked with .scss files but I'm not sure.

I've tested with NODE_OPTIONS=--max-old-space-size=17000 but also node --max_old_space_size=20000 node_modules/@angular/cli/bin/ng build --prod later, always the same issue even if I try with 8192 instead of 17000 or 20000.

I know, this memory problem has already been opened multiple times, like here #13734, but it seems to be a persistent issue

Terminal

ng serve
Your global Angular CLI version (9.0.2) is greater than your local
version (8.3.24). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
10% building 3/3 modules 0 activeℹ 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to //index.html
69% building 1089/1091 modules 2 active ...cts/kiss/wdm-frontend/src/app/shared/components/requests/request-details/request-details.component.scss
<--- Last few GCs --->

[5836:0x4d7c110]  2199612 ms: Mark-sweep 16887.9 (17035.7) -> 16873.6 (17036.4) MB, 18857.0 / 0.0 ms  (average mu = 0.170, current mu = 0.115) allocation failure scavenge might not succeed
[5836:0x4d7c110]  2213160 ms: Mark-sweep 16889.0 (17036.7) -> 16874.8 (17037.7) MB, 11231.8 / 0.1 ms  (average mu = 0.170, current mu = 0.171) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x145ce19]
Security context: 0x2ff30cd40921 <JSObject>
    1: accept$1 [0x78e6555b9d9] [/home/gokan/projects/kiss/wdm-frontend/node_modules/sass/sass.dart.js:~25927] [pc=0x26048f14d2ba](this=0x2853e5c2f751 <NumberExpression map = 0x11237f44f671>,0x3b9478e5d9a9 <_EvaluateVisitor0 map = 0x1a480715e851>)
    2: /* anonymous */ [0x2338e8302071] [/home/gokan/projects/kiss/wdm-frontend/node_modules/sass/sass.dart.js:~42948...

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

Writing Node.js report to file: report.20200219.094246.5836.0.001.json
Node.js report completed
 1: 0xa9d570 node::Abort() [ng serve]
 2: 0xa9f832 node::OnFatalError(char const*, char const*) [ng serve]
 3: 0xc0772e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng serve]
 4: 0xc07aa9 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng serve]
 5: 0xdb5fb5  [ng serve]
 6: 0xdb6646 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [ng serve]
 7: 0xdc4eb9 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng serve]
 8: 0xdc5cf5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng serve]
 9: 0xdc87cc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng serve]
10: 0xd8f3a4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng serve]
11: 0x10dc6ce v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng serve]
12: 0x145ce19  [ng serve]
Aborted (core dumped)

Generated JSON report

{
  "header": {
    "reportVersion": 1,
    "event": "Allocation failed - JavaScript heap out of memory",
    "trigger": "FatalError",
    "filename": "report.20200219.094246.5836.0.001.json",
    "dumpEventTime": "2020-02-19T09:42:46Z",
    "dumpEventTimeStamp": "1582101766414",
    "processId": 5836,
    "cwd": "/home/gokan/projects/kiss/wdm-frontend",
    "commandLine": [
      "node",
      "/usr/local/bin/ng",
      "serve"
    ],
    "nodejsVersion": "v13.8.0",
    "glibcVersionRuntime": "2.27",
    "glibcVersionCompiler": "2.17",
    "wordSize": 64,
    "arch": "x64",
    "platform": "linux",
    "componentVersions": {
      "node": "13.8.0",
      "v8": "7.9.317.25-node.28",
      "uv": "1.34.1",
      "zlib": "1.2.11",
      "brotli": "1.0.7",
      "ares": "1.15.0",
      "modules": "79",
      "nghttp2": "1.40.0",
      "napi": "5",
      "llhttp": "2.0.4",
      "openssl": "1.1.1d",
      "cldr": "36.0",
      "icu": "65.1",
      "tz": "2019c",
      "unicode": "12.1"
    },
    "release": {
      "name": "node",
      "headersUrl": "https://nodejs.org/download/release/v13.8.0/node-v13.8.0-headers.tar.gz",
      "sourceUrl": "https://nodejs.org/download/release/v13.8.0/node-v13.8.0.tar.gz"
    },
    "osName": "Linux",
    "osRelease": "5.3.0-40-generic",
    "osVersion": "#32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020",
    "osMachine": "x86_64",
    "cpus": [
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3574,
        "user": 2549600,
        "nice": 7400,
        "sys": 215000,
        "idle": 27786400,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3402,
        "user": 1542400,
        "nice": 13200,
        "sys": 238700,
        "idle": 28700200,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3319,
        "user": 6523000,
        "nice": 2900,
        "sys": 175000,
        "idle": 23912800,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3337,
        "user": 2483500,
        "nice": 3700,
        "sys": 178700,
        "idle": 27930000,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3410,
        "user": 5565500,
        "nice": 6600,
        "sys": 200500,
        "idle": 24842600,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3923,
        "user": 3523000,
        "nice": 4000,
        "sys": 190400,
        "idle": 26895300,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3439,
        "user": 3984400,
        "nice": 2100,
        "sys": 196200,
        "idle": 26412800,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3922,
        "user": 3893800,
        "nice": 4900,
        "sys": 177900,
        "idle": 26527000,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3922,
        "user": 3990100,
        "nice": 4800,
        "sys": 179900,
        "idle": 26416500,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3538,
        "user": 2786600,
        "nice": 4000,
        "sys": 187400,
        "idle": 27570700,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3759,
        "user": 2335400,
        "nice": 2400,
        "sys": 190500,
        "idle": 28045000,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz",
        "speed": 3436,
        "user": 3925900,
        "nice": 2400,
        "sys": 201400,
        "idle": 26371700,
        "irq": 0
      }
    ],
    "networkInterfaces": [
      {
        "name": "lo",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "127.0.0.1",
        "netmask": "255.0.0.0",
        "family": "IPv4"
      },
      {
        "name": "wlp59s0",
        "internal": false,
        "mac": "9c:b6:d0:bd:db:cd",
        "address": "10.22.46.71",
        "netmask": "255.255.240.0",
        "family": "IPv4"
      },
      {
        "name": "br-76dd0b077b0e",
        "internal": false,
        "mac": "02:42:f3:f5:c0:12",
        "address": "172.18.0.1",
        "netmask": "255.255.0.0",
        "family": "IPv4"
      },
      {
        "name": "lo",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "::1",
        "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
        "family": "IPv6",
        "scopeid": 0
      },
      {
        "name": "wlp59s0",
        "internal": false,
        "mac": "9c:b6:d0:bd:db:cd",
        "address": "fe80::d9b6:b17c:2f03:5f09",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 3
      },
      {
        "name": "br-76dd0b077b0e",
        "internal": false,
        "mac": "02:42:f3:f5:c0:12",
        "address": "fe80::42:f3ff:fef5:c012",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 5
      },
      {
        "name": "veth898b55c",
        "internal": false,
        "mac": "76:e8:2c:11:f4:9e",
        "address": "fe80::74e8:2cff:fe11:f49e",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 7
      }
    ],
    "host": "cyril-XPS-15-9570"
  },
  "javascriptStack": {
    "message": "No stack.",
    "stack": [
      "Unavailable."
    ]
  },
  "nativeStack": [
    {
      "pc": "0x0000000000bd0505",
      "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::string const&, v8::Local<v8::String>) [ng serve]"
    },
    {
      "pc": "0x0000000000a9f86c",
      "symbol": "node::OnFatalError(char const*, char const*) [ng serve]"
    },
    {
      "pc": "0x0000000000c0772e",
      "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng serve]"
    },
    {
      "pc": "0x0000000000c07aa9",
      "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng serve]"
    },
    {
      "pc": "0x0000000000db5fb5",
      "symbol": " [ng serve]"
    },
    {
      "pc": "0x0000000000db6646",
      "symbol": "v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [ng serve]"
    },
    {
      "pc": "0x0000000000dc4eb9",
      "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng serve]"
    },
    {
      "pc": "0x0000000000dc5cf5",
      "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng serve]"
    },
    {
      "pc": "0x0000000000dc87cc",
      "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng serve]"
    },
    {
      "pc": "0x0000000000d8f3a4",
      "symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng serve]"
    },
    {
      "pc": "0x00000000010dc6ce",
      "symbol": "v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng serve]"
    },
    {
      "pc": "0x000000000145ce19",
      "symbol": " [ng serve]"
    }
  ],
  "javascriptHeap": {
    "totalMemory": 17866625024,
    "totalCommittedMemory": 17863663600,
    "usedMemory": 17695760304,
    "availableMemory": 41901480,
    "memoryLimit": 17876123648,
    "heapSpaces": {
      "read_only_space": {
        "memorySize": 262144,
        "committedMemory": 33328,
        "capacity": 33040,
        "used": 33040,
        "available": 0
      },
      "new_space": {
        "memorySize": 33554432,
        "committedMemory": 31458024,
        "capacity": 16758784,
        "used": 1188832,
        "available": 15569952
      },
      "old_space": {
        "memorySize": 16452034560,
        "committedMemory": 16451607848,
        "capacity": 16336927808,
        "used": 16336853688,
        "available": 74120
      },
      "code_space": {
        "memorySize": 3837952,
        "committedMemory": 3736544,
        "capacity": 3224704,
        "used": 3224704,
        "available": 0
      },
      "map_space": {
        "memorySize": 26742784,
        "committedMemory": 26634704,
        "capacity": 4732880,
        "used": 4732880,
        "available": 0
      },
      "large_object_space": {
        "memorySize": 1349570560,
        "committedMemory": 1349570560,
        "capacity": 1349182616,
        "used": 1349182616,
        "available": 0
      },
      "code_large_object_space": {
        "memorySize": 622592,
        "committedMemory": 622592,
        "capacity": 544544,
        "used": 544544,
        "available": 0
      },
      "new_large_object_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 16758784,
        "used": 0,
        "available": 16758784
      }
    }
  },
  "resourceUsage": {
    "userCpuSeconds": 3570.78,
    "kernelCpuSeconds": 23.3403,
    "cpuConsumptionPercent": 160.524,
    "maxRss": 18407518208,
    "pageFaults": {
      "IORequired": 258,
      "IONotRequired": 11956074
    },
    "fsActivity": {
      "reads": 394776,
      "writes": 16
    }
  },
  "uvthreadResourceUsage": {
    "userCpuSeconds": 2169.15,
    "kernelCpuSeconds": 11.8079,
    "cpuConsumptionPercent": 97.4075,
    "fsActivity": {
      "reads": 388288,
      "writes": 16
    }
  },
  "libuv": [
  ],
  "environmentVariables": {
    "CLUTTER_IM_MODULE": "xim",
    "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:",
    "LC_MEASUREMENT": "fr_FR.UTF-8",
    "LESSCLOSE": "/usr/bin/lesspipe %s %s",
    "LC_PAPER": "fr_FR.UTF-8",
    "LC_MONETARY": "fr_FR.UTF-8",
    "XDG_MENU_PREFIX": "gnome-",
    "LANG": "en_US.UTF-8",
    "DISPLAY": ":0",
    "NODE_OPTIONS": "--max-old-space-size=17000",
    "OLDPWD": "/home/gokan/projects",
    "GNOME_SHELL_SESSION_MODE": "ubuntu",
    "MAVEN_HOME": "/opt/maven/apache-maven-3.6.3",
    "COLORTERM": "truecolor",
    "USERNAME": "gokan",
    "JAVA_HOME": "/opt/java/jdk1.8.0_241",
    "XDG_VTNR": "2",
    "SSH_AUTH_SOCK": "/run/user/1001/keyring/ssh",
    "LC_NAME": "fr_FR.UTF-8",
    "XDG_SESSION_ID": "2",
    "USER": "gokan",
    "DESKTOP_SESSION": "ubuntu",
    "QT4_IM_MODULE": "xim",
    "TEXTDOMAINDIR": "/usr/share/locale/",
    "GNOME_TERMINAL_SCREEN": "/org/gnome/Terminal/screen/39c51915_ab7c_46f4_9a94_587514984954",
    "PWD": "/home/gokan/projects/kiss/wdm-frontend",
    "HOME": "/home/gokan",
    "TEXTDOMAIN": "im-config",
    "SSH_AGENT_PID": "2488",
    "__GIT_PROMPT_SHOW_UNTRACKED_FILES": "",
    "QT_ACCESSIBILITY": "1",
    "XDG_SESSION_TYPE": "x11",
    "XDG_DATA_DIRS": "/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",
    "XDG_SESSION_DESKTOP": "ubuntu",
    "LC_ADDRESS": "fr_FR.UTF-8",
    "GJS_DEBUG_OUTPUT": "stderr",
    "LC_NUMERIC": "fr_FR.UTF-8",
    "GTK_MODULES": "gail:atk-bridge",
    "WINDOWPATH": "2",
    "VTE_VERSION": "5202",
    "TERM": "xterm-256color",
    "SHELL": "/bin/bash",
    "QT_IM_MODULE": "xim",
    "XMODIFIERS": "@im=ibus",
    "IM_CONFIG_PHASE": "2",
    "XDG_CURRENT_DESKTOP": "ubuntu:GNOME",
    "GPG_AGENT_INFO": "/run/user/1001/gnupg/S.gpg-agent:0:1",
    "GNOME_TERMINAL_SERVICE": ":1.68",
    "XDG_SEAT": "seat0",
    "SHLVL": "1",
    "GIT_BRANCH": "develop",
    "LC_TELEPHONE": "fr_FR.UTF-8",
    "GDMSESSION": "ubuntu",
    "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated",
    "LOGNAME": "gokan",
    "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1001/bus",
    "XDG_RUNTIME_DIR": "/run/user/1001",
    "XAUTHORITY": "/run/user/1001/gdm/Xauthority",
    "XDG_CONFIG_DIRS": "/etc/xdg/xdg-ubuntu:/etc/xdg",
    "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/maven/apache-maven-3.6.3/bin:/opt/java/jdk1.8.0_241/bin",
    "LC_IDENTIFICATION": "fr_FR.UTF-8",
    "GJS_DEBUG_TOPICS": "JS ERROR;JS LOG",
    "SESSION_MANAGER": "local/cyril-XPS-15-9570:@/tmp/.ICE-unix/2393,unix/cyril-XPS-15-9570:/tmp/.ICE-unix/2393",
    "LESSOPEN": "| /usr/bin/lesspipe %s",
    "GTK_IM_MODULE": "ibus",
    "LC_TIME": "fr_FR.UTF-8",
    "_": "/usr/local/bin/ng",
    "BROWSERSLIST_IGNORE_OLD_DATA": "1",
    "WEBPACK_DEV_SERVER": "true"
  },
  "userLimits": {
    "core_file_size_blocks": {
      "soft": 0,
      "hard": "unlimited"
    },
    "data_seg_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "file_size_blocks": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_locked_memory_bytes": {
      "soft": 16777216,
      "hard": 16777216
    },
    "max_memory_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "open_files": {
      "soft": 4096,
      "hard": 4096
    },
    "stack_size_bytes": {
      "soft": 8388608,
      "hard": "unlimited"
    },
    "cpu_time_seconds": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_user_processes": {
      "soft": 126765,
      "hard": 126765
    },
    "virtual_memory_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    }
  },
  "sharedObjects": [
    "linux-vdso.so.1",
    "/lib/x86_64-linux-gnu/libdl.so.2",
    "/usr/lib/x86_64-linux-gnu/libstdc++.so.6",
    "/lib/x86_64-linux-gnu/libm.so.6",
    "/lib/x86_64-linux-gnu/libgcc_s.so.1",
    "/lib/x86_64-linux-gnu/libpthread.so.0",
    "/lib/x86_64-linux-gnu/libc.so.6",
    "/lib64/ld-linux-x86-64.so.2",
    "/lib/x86_64-linux-gnu/libnss_files.so.2"
  ]
}

Softwares

  • Node: 13.8.0
  • NPM: 6.13.7
  • ng version:
Angular CLI: 8.3.24
Node: 13.8.0
OS: linux x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.24
@angular-devkit/build-angular     0.803.24
@angular-devkit/build-optimizer   0.803.24
@angular-devkit/build-webpack     0.803.24
@angular-devkit/core              8.3.24
@angular-devkit/schematics        8.3.24
@angular/cdk                      8.0.0
@angular/cli                      8.3.24
@angular/flex-layout              8.0.0-beta.27
@angular/material                 8.0.0
@ngtools/webpack                  8.3.24
@schematics/angular               8.3.24
@schematics/update                0.803.24
rxjs                              6.5.4
typescript                        3.5.3
webpack                           4.39.2

My computer

  • OS: Ubuntu 18.04.4 LTS (64 bit)
  • Memory: 31,0 GiB
  • Processor: Intel® Core™ i9-8950HK CPU @ 2.90GHz × 12
@alan-agius4
Copy link
Collaborator

Can you try using Node v12.4.0+? There are some node versions that suffer from memory issues.

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Feb 20, 2020
@eau-de-la-seine
Copy link
Author

I've uninstalled node v13.8.0 and installed node v12.16.1

I have a war machine under my control and still can't control JavaScript related tools 🤣

With 20000:

node --max_old_space_size=20000 node_modules/@angular/cli/bin/ng build --prod
54% building 291/292 modules 1 active ...extracted!/home/gokan/projects/kiss/wdm-frontend/node_modules/sass-loader/lib/loader.js??ref--15-3!/home/gokan/projects/kiss/wdm-frontend/src/assets/scss/app.scss
<--- Last few GCs --->

[8546:0x47fd550]   772392 ms: Scavenge 17333.8 (17537.1) -> 17320.5 (17538.9) MB, 48.9 / 0.0 ms  (average mu = 0.938, current mu = 0.918) allocation failure 
[8546:0x47fd550]   772458 ms: Scavenge 17337.9 (17541.1) -> 17324.6 (17543.1) MB, 49.2 / 0.0 ms  (average mu = 0.938, current mu = 0.918) allocation failure 
[8546:0x47fd550]   772528 ms: Scavenge 17342.0 (17545.4) -> 17328.7 (17546.1) MB, 53.1 / 0.0 ms  (average mu = 0.938, current mu = 0.918) allocation failure 


<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: NewSpace::Rebalance Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20200220.111519.8546.0.001.json
Node.js report completed
 1: 0x9ef190 node::Abort() [ng build --prod]
 2: 0x9f13b2 node::OnFatalError(char const*, char const*) [ng build --prod]
 3: 0xb5da9e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --prod]
 4: 0xb5de19 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --prod]
 5: 0xd0a765  [ng build --prod]
 6: 0xd545ee  [ng build --prod]
 7: 0xd58797 v8::internal::MarkCompactCollector::CollectGarbage() [ng build --prod]
 8: 0xd16c39 v8::internal::Heap::MarkCompact() [ng build --prod]
 9: 0xd179a3 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng build --prod]
10: 0xd18515 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --prod]
11: 0xd1afcc v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build --prod]
12: 0xce19bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng build --prod]
13: 0x102482c v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [ng build --prod]
14: 0x13a71b9  [ng build --prod]
Aborted (core dumped)

With 8192 (the error message is a bit different from 20000) :

node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod
54% building 291/292 modules 1 active ...extracted!/home/gokan/projects/kiss/wdm-frontend/node_modules/sass-loader/lib/loader.js??ref--15-3!/home/gokan/projects/kiss/wdm-frontend/src/assets/scss/app.scss
<--- Last few GCs --->

[9369:0x3157550]   871076 ms: Scavenge 8009.5 (8200.5) -> 8008.7 (8200.7) MB, 20.8 / 0.0 ms  (average mu = 0.278, current mu = 0.001) allocation failure 
[9369:0x3157550]   871100 ms: Scavenge 8009.7 (8200.7) -> 8008.9 (8201.0) MB, 22.1 / 0.0 ms  (average mu = 0.278, current mu = 0.001) allocation failure 
[9369:0x3157550]   878350 ms: Mark-sweep 8010.0 (8201.0) -> 7966.6 (8201.0) MB, 7247.7 / 0.0 ms  (average mu = 0.381, current mu = 0.488) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x13a71b9]
Security context: 0x2bfb694008d1 <JSObject>
    1: _extendCompound$4$inOriginal [0x351cdbcee311] [/home/gokan/projects/kiss/wdm-frontend/node_modules/sass/sass.dart.js:~30446] [pc=0x15bfb8d375fb](this=0x31d7d611a3c9 <Extender map = 0x2d014a66b189>,0x383f58b8d331 <CompoundSelector map = 0x1c76f7ddb289>,0x31d7d611a789 <JsLinkedHashMap map = 0x2d014a660559>,0x204aa37801b9 <null>,0x204aa3780639 <true>)
    2: ...

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

Writing Node.js report to file: report.20200220.114700.9369.0.001.json
Node.js report completed
 1: 0x9ef190 node::Abort() [ng build --prod]
 2: 0x9f13b2 node::OnFatalError(char const*, char const*) [ng build --prod]
 3: 0xb5da9e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --prod]
 4: 0xb5de19 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --prod]
 5: 0xd0a765  [ng build --prod]
 6: 0xd0adf6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [ng build --prod]
 7: 0xd1760a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng build --prod]
 8: 0xd18515 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --prod]
 9: 0xd1afcc v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build --prod]
10: 0xce19bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng build --prod]
11: 0x10246ce v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng build --prod]
12: 0x13a71b9  [ng build --prod]
Aborted (core dumped)

@alan-agius4
Copy link
Collaborator

@eau-de-la-seine, is there anyway that you can share your project so that we can take a look at this issue?, even privately.

@eau-de-la-seine
Copy link
Author

I would have love to but I cannot send this company project. Anyway I've found a solution: remove the whole project and clone it again, now it works. This is still weird to me since the source code wasn't changed and even npm cache clean --force didn't work. Thanks for your time Alan :)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

2 participants