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

JavaScript heap out of memory since 1.14.0 #94

Open
Mikaciu opened this issue Aug 24, 2023 · 0 comments
Open

JavaScript heap out of memory since 1.14.0 #94

Mikaciu opened this issue Aug 24, 2023 · 0 comments

Comments

@Mikaciu
Copy link

Mikaciu commented Aug 24, 2023

Hello,

I'm having trouble running ESLint with the sort-class-members plugin because of a java heap out of memory issue.

My eslint-related packages:

{
    "@angular-eslint/eslint-plugin": "^16.1.0",
    "@typescript-eslint/eslint-plugin": "^6.2.1",
    "@typescript-eslint/eslint-plugin-tslint": "^6.2.1",
    "@typescript-eslint/parser": "^6.2.1",
    "eslint": "^8.46.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-import": "^2.28.0",
    "eslint-plugin-jsdoc": "^46.4.6",
    "eslint-plugin-sort-class-members": "~1.14.0",
    "eslint-plugin-unicorn": "^48.0.1",
    "tslint": "^6.1.3",
}

I'm using node v18.17.1.

The console output when using version >= 1.14.0:

> npx eslint -c .eslintrc.json --ext .ts -f json ./src

strict-type-predicates does not work without --strictNullChecks

<--- Last few GCs --->

[27608:0x6c997e0]    23766 ms: Mark-sweep (reduce) 1925.8 (2092.7) -> 1925.5 (2090.0) MB, 268.7 / 0.0 ms  (average mu = 0.104, current mu = 0.045) allocation failure; scavenge might not succeed
[27608:0x6c997e0]    23775 ms: Scavenge (reduce) 1927.2 (2090.6) -> 1927.3 (2091.6) MB, 6.4 / 0.0 ms  (average mu = 0.104, current mu = 0.045) allocation failure; 


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb83f50 node::Abort() [node]
 2: 0xa94834  [node]
 3: 0xd647c0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xd64b67 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xf42265  [node]
 6: 0xf43168 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xf53673  [node]
 8: 0xf544e8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf2ee4e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xf30217 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
11: 0xf10760 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
12: 0xf081d4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
13: 0xf0a568 v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node]
14: 0x133bf2c v8::internal::IncrementalStringBuilder::Extend() [node]
15: 0x1050f30 v8::internal::JsonStringifier::SerializeString(v8::internal::Handle<v8::internal::String>) [node]
16: 0x10528b1 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
17: 0x105448f v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
18: 0x1056cef v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
19: 0x105414a v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
20: 0x1056cef v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
21: 0x10569a3 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
22: 0x1057a3f v8::internal::JsonStringify(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
23: 0xdea777 v8::internal::Builtin_JsonStringify(int, unsigned long*, v8::internal::Isolate*) [node]
24: 0x17036b9  [node]
Aborted (core dumped)

When using the version 1.13.0 of the eslint-plugin-sort-class-members or when removing it from the .eslintrc.json file, the error is no longer reproducible.

ESlintrc configuration:

  "env": {
    "browser": true,
    "node": true,
    "jasmine": true
  },
  "extends": "eslint:recommended",
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "tsconfig.lint.json",
    "sourceType": "module"
  },
  "plugins": [
    "@typescript-eslint",
    "@typescript-eslint/tslint",
    "@angular-eslint",
    "eslint-plugin-jsdoc",
    "eslint-plugin-unicorn",
    "import",
    "sort-class-members"
  ],
  "rules": {
[...]

Could you please help ?

Thx !

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

No branches or pull requests

1 participant