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

Upgrading to Typescript Version > 5 causes an out of memory issue #56428

Closed
luthfib opened this issue Nov 16, 2023 · 1 comment
Closed

Upgrading to Typescript Version > 5 causes an out of memory issue #56428

luthfib opened this issue Nov 16, 2023 · 1 comment

Comments

@luthfib
Copy link

luthfib commented Nov 16, 2023

🔎 Search Terms

near heap limit Allocation failed - JavaScript heap out of memory. Typescript, Out of Memory, Typescript version 5 changelog.

🕗 Version & Regression Information

  • This changed between versions 4.74 and 5.2.2

⏯ Playground Link

https://github.com/zeus-health/ctw-component-library/tree/out-memory-typescript

💻 Code

// Your code here

🙁 Actual behavior

My app should build. What actual happens is it hangs when running npm run build.

I get the following error:

<--- Last few GCs --->

[5443:0x110040000]   194277 ms: Mark-sweep 4058.4 (4130.2) -> 4043.3 (4130.9) MB, 2004.5 / 0.0 ms  (average mu = 0.163, current mu = 0.112) allocation failure; scavenge might not succeed
[5443:0x110040000]   196755 ms: Mark-sweep 4059.1 (4130.9) -> 4044.1 (4131.7) MB, 2341.7 / 0.0 ms  (average mu = 0.111, current mu = 0.055) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1010a61dc node::Abort() [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 2: 0x1010a63cc node::ModifyCodeGenerationFromStrings(v8::Local<v8::Context>, v8::Local<v8::Value>, bool) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 3: 0x1011ec6e8 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 4: 0x101397450 v8::internal::EmbedderStackStateScope::EmbedderStackStateScope(v8::internal::Heap*, v8::internal::EmbedderStackStateScope::Origin, cppgc::EmbedderStackState) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 5: 0x10139b058 v8::internal::Heap::CollectSharedGarbage(v8::internal::GarbageCollectionReason) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 6: 0x10139804c v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*, v8::GCCallbackFlags) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 7: 0x1013954a4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 8: 0x10138a1dc v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
 9: 0x10138aa0c v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
10: 0x101370840 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
11: 0x10170084c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
12: 0x101a4d04c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
13: 0x101a4e1d0 Builtins_StringAdd_CheckNone [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
14: 0x101a7d424 Builtins_StringAddConvertRight [/Users/redacted_user/.nvm/versions/node/v18.11.0/bin/node]
15: 0x10679952c
16: 0x10650a2d0
17: 0x10650a1a8
18: 0x10650a1a8
19: 0x10650a1a8
20: 0x10650a1a8
21: 0x10650a1a8
22: 0x10650a1a8
23: 0x1072b8290
24: 0x106bce944
25: 0x106fc8280
26: 0x106f37db0
27: 0x10704e038
28: 0x106ced248
29: 0x10704dfb8
30: 0x106bcea14
31: 0x106fc8280
32: 0x106f37db0
33: 0x10704e038
34: 0x106ced248
35: 0x10704dfb8
36: 0x106bcea14
37: 0x106fc8280
38: 0x106f37db0
39: 0x10704e038
40: 0x106ced248
41: 0x10704dfb8
42: 0x106bcea14
43: 0x106fc8280
44: 0x106f37db0
45: 0x10704e038
46: 0x106cece7c
47: 0x10704dfb8
48: 0x106bcea14
49: 0x106fc8280
50: 0x106f37db0
51: 0x10704e038
52: 0x106ced248
53: 0x10704dfb8
54: 0x106bcea14
55: 0x106fc8280
56: 0x106f37db0
57: 0x10704e038
58: 0x106ced248
59: 0x10704dfb8
60: 0x106bcea14
61: 0x106fc8280
62: 0x106f37db0
63: 0x10704e038
64: 0x106ced248
65: 0x10704dfb8
66: 0x106bcea14
67: 0x106fc8280
68: 0x106f37db0
69: 0x10704e038
70: 0x106cece7c
71: 0x10704dfb8
72: 0x106bcea14
73: 0x106fc8280
74: 0x106f37db0
75: 0x10704e038
76: 0x106cece7c
77: 0x10704dfb8
78: 0x106bcea14
79: 0x106fc8280
80: 0x106f37db0
81: 0x10704e038
82: 0x106ced248
83: 0x10704dfb8
84: 0x106bcea14
85: 0x106fc8280
86: 0x106f37db0
87: 0x10704e038
88: 0x106ced248
89: 0x10704dfb8
90: 0x106bcea14
91: 0x106fc8280
92: 0x106f37db0
93: 0x10704e038
94: 0x106ced248
95: 0x10704dfb8
96: 0x106bcea14
97: 0x106fc8280
98: 0x106f37db0
99: 0x10704e038
100: 0x106ced248
101: 0x10704dfb8
102: 0x106bcea14
103: 0x106fc8280
104: 0x106f37db0
105: 0x10704e038
106: 0x1070ecfdc
107: 0x106af46e8
108: 0x10704fd18
109: 0x106fe516c
110: 0x10718c9fc
111: 0x1072b7024
112: 0x10704ff00
113: 0x106fe516c
114: 0x107058084
115: 0x10672541c
116: 0x1072ab590
117: 0x107208610
118: 0x1067266c8
119: 0x106bcdce4
120: 0x106fc8280
121: 0x106f37db0
122: 0x10704e038
123: 0x106bac750
124: 0x106cec894
125: 0x106bc82e4
126: 0x106fc8280
127: 0x106f37db0
128: 0x10704e038
129: 0x1070ecfdc
130: 0x106af46e8
131: 0x1067259e0
132: 0x107208fe0
133: 0x1072ab618
134: 0x1064d61ac
135: 0x107208a30
136: 0x107209068
137: 0x1072ab618
138: 0x107208610
139: 0x1072ab618
140: 0x107208610
141: 0x1072ab618
142: 0x107208610
143: 0x1067266c8
144: 0x107291950
145: 0x106fc8280
146: 0x106f37db0
147: 0x10704e038
148: 0x106bac750
149: 0x106cec894
150: 0x107291620
151: 0x106fc8280
152: 0x106f37db0
153: 0x10704e038
154: 0x1070ecfdc
155: 0x106af46e8
156: 0x1067259e0
157: 0x107208fe0
158: 0x1072ab618
159: 0x1064d61ac
160: 0x107208a30
161: 0x107209068
162: 0x1072ab618
163: 0x107208610
164: 0x1072ab618
165: 0x107208610
166: 0x1072ab618
167: 0x107208610
168: 0x1067266c8
169: 0x107291950
170: 0x106fc8280
171: 0x106f37db0
172: 0x10704e038
173: 0x106bac750
174: 0x106cec894
175: 0x107291620
176: 0x106fc8280
177: 0x106f37db0
178: 0x10704e038
179: 0x1070ecfdc
180: 0x106af46e8
181: 0x1067259e0
182: 0x107208fe0
183: 0x1072ab618
184: 0x1064d61ac
185: 0x107208a30
186: 0x107209068
187: 0x1072ab618
188: 0x107208610
189: 0x1072ab618
190: 0x107208610
191: 0x1072ab618
192: 0x107208610
193: 0x1067266c8
194: 0x107291950
195: 0x106fc8280
196: 0x106f37db0
197: 0x10704e038
198: 0x106bac750
199: 0x106cec894
200: 0x107291620
201: 0x106fc8280
202: 0x106f37db0
203: 0x10704e038
204: 0x1070ecfdc
205: 0x106af46e8
206: 0x1067259e0
207: 0x107208fe0
208: 0x1072ab618
209: 0x1064d61ac
210: 0x107208a30
211: 0x107209068
212: 0x1072ab618
213: 0x107208610
214: 0x1072ab618
215: 0x107208610
216: 0x1072ab618
217: 0x107208610
218: 0x1067266c8
219: 0x107291950
220: 0x106fc8280
221: 0x106f37db0
222: 0x10704e038
223: 0x106bac750
224: 0x106cec894
225: 0x107291620
226: 0x106fc8280
227: 0x106f37db0
228: 0x10704e038
229: 0x1070ecfdc
230: 0x106af46e8
231: 0x1067259e0
232: 0x107208fe0
233: 0x1072ab618
234: 0x1064d61ac
235: 0x107208a30
236: 0x107209068
237: 0x1072ab618
238: 0x107208610
239: 0x1072ab618
240: 0x107208610
241: 0x1072ab618
242: 0x107208610
243: 0x1067266c8
244: 0x107291950
245: 0x106fc8280
246: 0x106f37db0
247: 0x10704e038
248: 0x106bac750
249: 0x106cec894
250: 0x107291620
251: 0x106fc8280
252: 0x106f37db0
253: 0x10704e038
254: 0x1070ecfdc
255: 0x106af46e8
sh: line 1:  5443 Abort trap: 6           tsc
 ELIFECYCLE  Command failed with exit code 134.

🙂 Expected behavior

I would expect my app to continue to build successfully like it did in versions prior 5.

Additional information about the issue

In order to reproduce clone the following repo https://github.com/zeus-health/ctw-component-library/tree/out-memory-typescript and do the following actions.

npm install
npm run build

Other potential relevant info:

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000
Binaries:
  Node: 18.11.0
  npm: 8.19.2
  Yarn: N/A
  pnpm: 8.9.2
@andrewbranch
Copy link
Member

This is already fixed in typescript@next.

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

2 participants