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

"Allocation failed - JavaScript heap out of memory" when using incorrect CSS value with a comment #3443

Closed
dmitriy-drenkaliuk opened this issue Oct 11, 2019 · 15 comments

Comments

@dmitriy-drenkaliuk
Copy link

OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

Less.js version:

$ lessc --version
lessc 3.10.3 (Less Compiler) [JavaScript]

main.less:

.test {
    color: #fffff /* comment */;
}

(note that the color property value is incorrect)

Expected result (you can get this if you remove the comment):

$ lessc main.less main.css
ParseError: Unrecognised input in /home/flash/main.less on line 2, column 18:
1 .test {
2     color: #fffff;
3 }

Actual result:

$ lessc main.less main.css

<--- Last few GCs --->

[22053:0x2c329a0]     7929 ms: Mark-sweep 1268.5 (1442.5) -> 1259.4 (1443.0) MB, 255.8 / 0.0 ms  (average mu = 0.140, current mu = 0.043) allocation failure scavenge might not succeed
[22053:0x2c329a0]     8195 ms: Mark-sweep 1271.2 (1443.0) -> 1263.0 (1445.0) MB, 255.5 / 0.0 ms  (average mu = 0.091, current mu = 0.039) allocation failure scavenge might not succeed


<--- JS stacktrace --->

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

Security context: 0x0f92c181e6e1 <JSObject>
    0: builtin exit frame: defineProperty(this=0x0f92c1804631 <JSFunction Object (sfi = 0x22999e78e301)>,0x25b50f3f19f9 <Object map = 0x19dee123a331>,0x2491b7d79d19 <String[15]: currentFileInfo>,0x25b50f3f1959 <Comment map = 0xb9e083900c1>,0x0f92c1804631 <JSFunction Object (sfi = 0x22999e78e301)>)

    1: expression [0x1e31b86c9279] [/home/flash/.nvm/versions/node/v10.15.2/lib/node_modules/less/...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8dc1c0 node::Abort() [node]
 2: 0x8dc20c  [node]
 3: 0xad60ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xad62e4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xec3972  [node]
 6: 0xec3a78 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xecfb52 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xed0484 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xed30f1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xe9c1e6 v8::internal::Factory::AllocateRawArray(int, v8::internal::PretenureFlag) [node]
11: 0xe9ca6a v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [node]
12: 0xe9cb10 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::Heap::RootListIndex, int, v8::internal::PretenureFlag) [node]
13: 0xfdc029 v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::PretenureFlag, v8::internal::MinimumCapacity) [node]
14: 0xfdc089 v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::PretenureFlag, v8::internal::MinimumCapacity) [node]
15: 0x10014ee v8::internal::JSObject::MigrateToMap(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Map>, int) [node]
16: 0xfb4c42 v8::internal::LookupIterator::TransitionToAccessorProperty(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes) [node]
17: 0xfca59b v8::internal::JSObject::DefineAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes) [node]
18: 0xff1520 v8::internal::JSReceiver::ValidateAndApplyPropertyDescriptor(v8::internal::Isolate*, v8::internal::LookupIterator*, bool, v8::internal::PropertyDescriptor*, v8::internal::PropertyDescriptor*, v8::internal::ShouldThrow, v8::internal::Handle<v8::internal::Name>) [node]
19: 0xff8c16 v8::internal::JSReceiver::OrdinaryDefineOwnProperty(v8::internal::LookupIterator*, v8::internal::PropertyDescriptor*, v8::internal::ShouldThrow) [node]
20: 0xff90b8 v8::internal::JSReceiver::OrdinaryDefineOwnProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDescriptor*, v8::internal::ShouldThrow) [node]
21: 0x1008722 v8::internal::JSReceiver::DefineOwnProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDescriptor*, v8::internal::ShouldThrow) [node]
22: 0x1008cfd v8::internal::JSReceiver::DefineProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
23: 0xbad634 v8::internal::Builtin_ObjectDefineProperty(int, v8::internal::Object**, v8::internal::Isolate*) [node]
24: 0x3e5aaf25bf7d 
Aborted (core dumped)
@matthew-dean
Copy link
Member

@dmitriy-drenkalyuk possibly related to: #3434? Can you try the 3.11.0 build and see if you have the same issue?

@dmitriy-drenkaliuk
Copy link
Author

@matthew-dean yeah, the same issue is in version 3.11.0.

@matthew-dean
Copy link
Member

matthew-dean commented Oct 15, 2019

@dmitriy-drenkalyuk Ah okay, I'm able to reproduce now. Interesting bug (and no, not related to #3434).

@rgroothuijsen
Copy link
Contributor

Played around with the example a bit, and it appears that the value not only has to be incorrect, but the bug also disappears if you remove the # in front of the value.

@matthew-dean
Copy link
Member

@rgroothuijsen Yes, I believe what's happening is that the parser is essentially not recovering the correct position from an invalid color value, so it's going into an infinite loop.

@rgroothuijsen
Copy link
Contributor

@matthew-dean Yep, that seems to be what I'm observing so far. I'm not very familiar with the code yet but from what I can tell it creates a save state before processing the color value, does nothing to handle this particular case, and after processing the comment it goes back to the save state to do the same thing.

@rgroothuijsen
Copy link
Contributor

Additional observation: the infinite loop only happens if you have a faulty color value and you place the comment in the middle of the line. If you place the comment after the ;, the bug does not show up.

@mikebronner
Copy link

I'm getting a similar error, but I don't think it is due to an infinite loop. I am employing heavily nested each loops -- 8 layers deep. Is there a way to optimize memory usage, or provide memory arguments to the lessc command?

I'm using the following:
node 12.13.0
lessc 3.10.3

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

Writing Node.js report to file: report.20191119.061916.24868.0.001.json
Node.js report completed
 1: 0x10007e743 node::Abort() [/usr/local/bin/node]
 2: 0x10007e8c7 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 3: 0x100176267 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0x100176203 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0x1002fa2b5 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
 6: 0x1002fb984 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
 7: 0x1002f8857 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
 8: 0x1002f683d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 9: 0x100301f54 v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x100301fcf v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0x1002cebc7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [/usr/local/bin/node]
12: 0x1005f7725 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
13: 0x10092fbd9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
14: 0x3e83883ceaac 
[1]    24868 abort      lessc _fonts.less > test.css

Here is the report file:


{
  "header": {
    "reportVersion": 1,
    "event": "Allocation failed - JavaScript heap out of memory",
    "trigger": "FatalError",
    "filename": "report.20191119.061916.24868.0.001.json",
    "dumpEventTime": "2019-11-19T06:19:16Z",
    "dumpEventTimeStamp": "1574173156979",
    "processId": 24868,
    "cwd": "/Users/mike/Developer/Kactus/tailwindcss-sketch-design-system/puzzle-tokens-resources",
    "commandLine": [
      "node",
      "/usr/local/bin/lessc",
      "_fonts.less"
    ],
    "nodejsVersion": "v12.13.0",
    "wordSize": 64,
    "arch": "x64",
    "platform": "darwin",
    "componentVersions": {
      "node": "12.13.0",
      "v8": "7.7.299.13-node.12",
      "uv": "1.32.0",
      "zlib": "1.2.11",
      "brotli": "1.0.7",
      "ares": "1.15.0",
      "modules": "72",
      "nghttp2": "1.39.2",
      "napi": "5",
      "llhttp": "1.1.4",
      "http_parser": "2.8.0",
      "openssl": "1.1.1d",
      "cldr": "35.1",
      "icu": "64.2",
      "tz": "2019a",
      "unicode": "12.1"
    },
    "release": {
      "name": "node",
      "lts": "Erbium",
      "headersUrl": "https://nodejs.org/download/release/v12.13.0/node-v12.13.0-headers.tar.gz",
      "sourceUrl": "https://nodejs.org/download/release/v12.13.0/node-v12.13.0.tar.gz"
    },
    "osName": "Darwin",
    "osRelease": "19.0.0",
    "osVersion": "Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64",
    "osMachine": "x86_64",
    "cpus": [
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 116447150,
        "nice": 0,
        "sys": 105919600,
        "idle": 1568470950,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 15526540,
        "nice": 0,
        "sys": 7627950,
        "idle": 1767682750,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 102186090,
        "nice": 0,
        "sys": 68988610,
        "idle": 1619662550,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 15360730,
        "nice": 0,
        "sys": 6386710,
        "idle": 1769089800,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 87432500,
        "nice": 0,
        "sys": 46716380,
        "idle": 1656688370,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 15587780,
        "nice": 0,
        "sys": 5707870,
        "idle": 1769541580,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 75681110,
        "nice": 0,
        "sys": 31764360,
        "idle": 1683391770,
        "irq": 0
      },
      {
        "model": "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz",
        "speed": 4000,
        "user": 15911430,
        "nice": 0,
        "sys": 5149950,
        "idle": 1769775840,
        "irq": 0
      }
    ],
    "networkInterfaces": [
      {
        "name": "lo0",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "127.0.0.1",
        "netmask": "255.0.0.0",
        "family": "IPv4"
      },
      {
        "name": "lo0",
        "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": "lo0",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::1",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 1
      },
      {
        "name": "en1",
        "internal": false,
        "mac": "b8:09:8a:cf:a4:7f",
        "address": "fe80::82b:f188:589:f1d7",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 4
      },
      {
        "name": "en1",
        "internal": false,
        "mac": "b8:09:8a:cf:a4:7f",
        "address": "192.168.7.219",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "en0",
        "internal": false,
        "mac": "ac:87:a3:0d:09:d4",
        "address": "fe80::1c36:c50f:a002:df4a",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 5
      },
      {
        "name": "en0",
        "internal": false,
        "mac": "ac:87:a3:0d:09:d4",
        "address": "192.168.7.251",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "vnic0",
        "internal": false,
        "mac": "00:1c:42:00:00:08",
        "address": "10.211.55.2",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "vnic1",
        "internal": false,
        "mac": "00:1c:42:00:00:09",
        "address": "10.37.129.2",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "vnic2",
        "internal": false,
        "mac": "00:1c:42:00:00:0a",
        "address": "192.168.10.1",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "awdl0",
        "internal": false,
        "mac": "96:dd:9a:34:45:c6",
        "address": "fe80::94dd:9aff:fe34:45c6",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 13
      },
      {
        "name": "llw0",
        "internal": false,
        "mac": "96:dd:9a:34:45:c6",
        "address": "fe80::94dd:9aff:fe34:45c6",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 14
      },
      {
        "name": "utun0",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::ad66:9af3:f67c:ddec",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 15
      },
      {
        "name": "utun1",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::6646:5b73:912d:6abe",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 16
      },
      {
        "name": "utun2",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::d6f3:a26a:2a1d:9b9a",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 17
      },
      {
        "name": "utun3",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::ca2f:b4ed:d14f:405c",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 18
      },
      {
        "name": "utun4",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::1015:cf85:6efe:cf69",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 19
      },
      {
        "name": "utun5",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::20de:4035:987f:2f10",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 21
      },
      {
        "name": "ipsec0",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::ba09:8aff:fecf:a47f",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 20
      },
      {
        "name": "ipsec0",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "2607:fb90:5c2:bf9f:ed15:448:ee49:db00",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 0
      },
      {
        "name": "utun6",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::2057:2fef:25:2ca",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 22
      },
      {
        "name": "utun7",
        "internal": false,
        "mac": "00:00:00:00:00:00",
        "address": "fe80::7ee3:4364:4803:8c8d",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 23
      }
    ],
    "host": "Mikes-iMac.local"
  },
  "javascriptStack": {
    "message": "No stack.",
    "stack": [
      "Unavailable."
    ]
  },
  "nativeStack": [
    {
      "pc": "0x000000010014da5c",
      "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, v8::Local<v8::String>) [/usr/local/bin/node]"
    },
    {
      "pc": "0x000000010007e8a3",
      "symbol": "node::OnFatalError(char const*, char const*) [/usr/local/bin/node]"
    },
    {
      "pc": "0x0000000100176267",
      "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]"
    },
    {
      "pc": "0x0000000100176203",
      "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]"
    },
    {
      "pc": "0x00000001002fa2b5",
      "symbol": "v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]"
    },
    {
      "pc": "0x00000001002fb984",
      "symbol": "v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]"
    },
    {
      "pc": "0x00000001002f8857",
      "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]"
    },
    {
      "pc": "0x00000001002f683d",
      "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]"
    },
    {
      "pc": "0x0000000100301f54",
      "symbol": "v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]"
    },
    {
      "pc": "0x0000000100301fcf",
      "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]"
    },
    {
      "pc": "0x00000001002cebc7",
      "symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [/usr/local/bin/node]"
    },
    {
      "pc": "0x00000001005f7725",
      "symbol": "v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]"
    },
    {
      "pc": "0x000000010092fbd9",
      "symbol": "Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]"
    },
    {
      "pc": "0x00003e83883ceaac",
      "symbol": ""
    }
  ],
  "javascriptHeap": {
    "totalMemory": 2170429440,
    "totalCommittedMemory": 2164675232,
    "usedMemory": 1906764048,
    "availableMemory": 94976160,
    "memoryLimit": 2197815296,
    "heapSpaces": {
      "read_only_space": {
        "memorySize": 262144,
        "committedMemory": 32568,
        "capacity": 261872,
        "used": 32296,
        "available": 229576
      },
      "new_space": {
        "memorySize": 33554432,
        "committedMemory": 29363640,
        "capacity": 16759808,
        "used": 3197592,
        "available": 13562216
      },
      "old_space": {
        "memorySize": 2104340480,
        "committedMemory": 2103163488,
        "capacity": 1914326952,
        "used": 1877288248,
        "available": 37038704
      },
      "code_space": {
        "memorySize": 688128,
        "committedMemory": 580544,
        "capacity": 541920,
        "used": 541920,
        "available": 0
      },
      "map_space": {
        "memorySize": 28839936,
        "committedMemory": 28790672,
        "capacity": 23014960,
        "used": 23014960,
        "available": 0
      },
      "large_object_space": {
        "memorySize": 2695168,
        "committedMemory": 2695168,
        "capacity": 2685480,
        "used": 2685480,
        "available": 0
      },
      "code_large_object_space": {
        "memorySize": 49152,
        "committedMemory": 49152,
        "capacity": 3552,
        "used": 3552,
        "available": 0
      },
      "new_large_object_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 16759808,
        "used": 0,
        "available": 16759808
      }
    }
  },
  "resourceUsage": {
    "userCpuSeconds": 97.4318,
    "kernelCpuSeconds": 3.60013,
    "cpuConsumptionPercent": 183.694,
    "maxRss": 2320620322816,
    "pageFaults": {
      "IORequired": 2,
      "IONotRequired": 1124137
    },
    "fsActivity": {
      "reads": 0,
      "writes": 0
    }
  },
  "libuv": [
  ],
  "environmentVariables": {
    "USER": "mike",
    "PATH": "/Users/mike/.yarn/bin:/Users/mike/.config/yarn/global/node_modules/.bin:/Users/mike/.composer/vendor/bin:/usr/local/php5/bin:/Users/mike/.gem/ruby/2.6.0/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/mike/.yarn/bin:/Users/mike/.config/yarn/global/node_modules/.bin:/Users/mike/.composer/vendor/bin:/usr/local/php5/bin:/Users/mike/.gem/ruby/2.6.0/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin",
    "LOGNAME": "mike",
    "SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.NvVaYHubDr/Listeners",
    "HOME": "/Users/mike",
    "SHELL": "/bin/zsh",
    "__CF_USER_TEXT_ENCODING": "0x1F5:0:0",
    "TMPDIR": "/var/folders/k8/vy_1t24s075cnqhjpy2f6qx80000gn/T/",
    "XPC_SERVICE_NAME": "0",
    "XPC_FLAGS": "0x0",
    "LESS": "-R",
    "LSCOLORS": "Gxfxcxdxbxegedabagacad",
    "NVM_DIR": "/Users/mike/.nvm",
    "OLDPWD": "/Users/mike/Developer/Kactus/tailwindcss-sketch-design-system",
    "PAGER": "less",
    "PWD": "/Users/mike/Developer/Kactus/tailwindcss-sketch-design-system/puzzle-tokens-resources",
    "SHLVL": "1",
    "ZSH": "/Users/mike/.oh-my-zsh",
    "TERM_PROGRAM": "vscode",
    "TERM_PROGRAM_VERSION": "1.41.0-insider",
    "LANG": "en_US.UTF-8",
    "COLORTERM": "truecolor",
    "TERM": "xterm-256color",
    "LC_CTYPE": "en_US.UTF-8",
    "_": "/usr/local/bin/lessc"
  },
  "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": "unlimited",
      "hard": "unlimited"
    },
    "max_memory_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "open_files": {
      "soft": 49152,
      "hard": "unlimited"
    },
    "stack_size_bytes": {
      "soft": 8388608,
      "hard": 67104768
    },
    "cpu_time_seconds": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_user_processes": {
      "soft": 5568,
      "hard": 8352
    },
    "virtual_memory_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    }
  },
  "sharedObjects": [
    "/usr/local/bin/node",
    "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation",
    "/usr/lib/libSystem.B.dylib",
    "/usr/lib/libc++.1.dylib",
    "/usr/lib/libobjc.A.dylib",
    "/usr/lib/libfakelink.dylib",
    "/usr/lib/libDiagnosticMessagesClient.dylib",
    "/usr/lib/libicucore.A.dylib",
    "/usr/lib/libz.1.dylib",
    "/usr/lib/libc++abi.dylib",
    "/usr/lib/system/libcache.dylib",
    "/usr/lib/system/libcommonCrypto.dylib",
    "/usr/lib/system/libcompiler_rt.dylib",
    "/usr/lib/system/libcopyfile.dylib",
    "/usr/lib/system/libcorecrypto.dylib",
    "/usr/lib/system/libdispatch.dylib",
    "/usr/lib/system/libdyld.dylib",
    "/usr/lib/system/libkeymgr.dylib",
    "/usr/lib/system/liblaunch.dylib",
    "/usr/lib/system/libmacho.dylib",
    "/usr/lib/system/libquarantine.dylib",
    "/usr/lib/system/libremovefile.dylib",
    "/usr/lib/system/libsystem_asl.dylib",
    "/usr/lib/system/libsystem_blocks.dylib",
    "/usr/lib/system/libsystem_c.dylib",
    "/usr/lib/system/libsystem_configuration.dylib",
    "/usr/lib/system/libsystem_coreservices.dylib",
    "/usr/lib/system/libsystem_darwin.dylib",
    "/usr/lib/system/libsystem_dnssd.dylib",
    "/usr/lib/system/libsystem_featureflags.dylib",
    "/usr/lib/system/libsystem_info.dylib",
    "/usr/lib/system/libsystem_m.dylib",
    "/usr/lib/system/libsystem_malloc.dylib",
    "/usr/lib/system/libsystem_networkextension.dylib",
    "/usr/lib/system/libsystem_notify.dylib",
    "/usr/lib/system/libsystem_sandbox.dylib",
    "/usr/lib/system/libsystem_secinit.dylib",
    "/usr/lib/system/libsystem_kernel.dylib",
    "/usr/lib/system/libsystem_platform.dylib",
    "/usr/lib/system/libsystem_pthread.dylib",
    "/usr/lib/system/libsystem_symptoms.dylib",
    "/usr/lib/system/libsystem_trace.dylib",
    "/usr/lib/system/libunwind.dylib",
    "/usr/lib/system/libxpc.dylib"
  ]
}

@HuiiBuh
Copy link

HuiiBuh commented Apr 28, 2020

I have got the same problem.
Is there an update?

@rgroothuijsen
Copy link
Contributor

Came across something, though I can't entirely explain it. There's a loop starting here that was occurring a lot while I was debugging. It first checks if the current expression is a comment, and if not it continues to checking if it's an entity...which might also be a comment. Somehow, the returned object was indeed of type Comment. Adding a type check to prevent processing comments seemed to solve the problem.

@matthew-dean
Copy link
Member

@rgroothuijsen You're saying that solved the memory issue?

@rgroothuijsen
Copy link
Contributor

@matthew-dean Yes, the test case provided here immediately exited out with an error. Without the fix, this array just kept growing bigger.

@matthew-dean
Copy link
Member

@rgroothuijsen Can you provide a PR, with your test cases along with a write-up of your findings? It would be much appreciated.

@sharvilak11
Copy link

Hey Matthew, Any idea when will this be published on npm ? @matthew-dean

@matthew-dean
Copy link
Member

Fixed by #3494

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

No branches or pull requests

6 participants