element-hq / element-hq/element-web

`yarn start` crashes with "JavaScript heap out of memory" after a while

Open
#23,434 5 comments 0 reactions 0 assignees View on GitHub
A-Developer-Experience O-Occasional S-Minor T-Defect Z-Upstream
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

1. Set up a dev environment
2. Run `yarn start`
3. Edit the source code

### Outcome

#### What did you expect?

No crash

#### What happened instead?

After a while the process crashes with „JavaScript heap out of memory“

Log

```
2022-10-06 15:14:57.579 [element-js]
2022-10-06 15:14:57.579 [element-js] <--- Last few GCs --->
2022-10-06 15:14:57.579 [element-js]
2022-10-06 15:14:57.579 [element-js] [46054:0x673ff00] 11676387 ms: Mark-sweep 1994.2 (2066.3) -> 1973.6 (2045.6) MB, 167.9 / 0.1 ms (average mu = 0.150, current mu = 0.115) allocation failure scavenge might not succeed
2022-10-06 15:14:57.579 [element-js] [46054:0x673ff00] 11676395 ms: Scavenge 1989.1 (2061.1) -> 1976.2 (2048.2) MB, 1.2 / 0.0 ms (average mu = 0.150, current mu = 0.115) allocation failure
2022-10-06 15:14:57.579 [element-js] [46054:0x673ff00] 11676403 ms: Scavenge 1991.7 (2063.7) -> 1978.7 (2050.8) MB, 1.2 / 0.0 ms (average mu = 0.150, current mu = 0.115) allocation failure
2022-10-06 15:14:57.579 [element-js]
2022-10-06 15:14:57.579 [element-js]
2022-10-06 15:14:57.579 [element-js] <--- JS stacktrace --->
2022-10-06 15:14:57.579 [element-js]
2022-10-06 15:14:57.579 [element-js] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
2022-10-06 15:14:57.594 [element-js] 1: 0xb02960 node::Abort() [/usr/bin/node]
2022-10-06 15:14:57.594 [element-js] 2: 0xa18149 node::FatalError(char const*, char const*) [/usr/bin/node]
2022-10-06 15:14:57.594 [element-js] 3: 0xcdd22e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
2022-10-06 15:14:57.595 [element-js] 4: 0xcdd5a7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
2022-10-06 15:14:57.595 [element-js] 5: 0xe94c15 [/usr/bin/node]
2022-10-06 15:14:57.596 [element-js] 6: 0xe956f6 [/usr/bin/node]
2022-10-06 15:14:57.596 [element-js] 7: 0xea3c1e [/usr/bin/node]
2022-10-06 15:14:57.596 [element-js] 8: 0xea4660 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
2022-10-06 15:14:57.597 [element-js] 9: 0xea75de v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]
2022-10-06 15:14:57.597 [element-js] 10: 0xe68852 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/bin/node]
2022-10-06 15:14:57.598 [element-js] 11: 0xe60e64 v8::internal::FactoryBase::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/usr/bin/node]
2022-10-06 15:14:57.598 [element-js] 12: 0xe62ec1 v8::internal::FactoryBase::NewRawTwoByteString(int, v8::internal::AllocationType) [/usr/bin/node]
2022-10-06 15:14:57.599 [element-js] 13: 0x1200c49 v8::internal::Runtime_StringBuilderConcat(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]
2022-10-06 15:14:57.599 [element-js] 14: 0x15d54f9 [/usr/bin/node]
2022-10-06 15:15:51.535 [element-js] Aborted (core dumped)
```

### Operating system

Ubuntu 22.04.1 LTS

### Browser information

Firefox 105.0.2 (64-bit)

### URL for webapp

_No response_

### Application version

fb686ec5b6b6e7609ffdae6ba764ff958ea0cda8

### Homeserver

_No response_

### Will you send logs?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.