Relationships
#1673 Fatal JavaScript out of memory: Ineffective mark-compacts near heap limit
Opened by jesserobbins · 8/16/2026
Description
I am experiencing an out-of-memory bug that results in a crash loop. Running a large data processing job hits a Fatal OOM. It is a workflow that parses 17 WhatsApp groups, runs them through a multi-stage parsing and extraction flow, organizes them, and reports back. The workflow runs a set of parallel parse jobs, then a sequential chain of extraction jobs, all in one swamp workflow run process.
<--- Last few GCs --->
[53699:0x7a13694000] 15302 ms: Scavenge (during sweeping) 4085.1 (4092.9) -> 4082.5 (4093.4) MB, pooled: 0.0 MB, 2.48 / 0.00 ms (average mu = 0.222, current mu = 0.168) allocation failure; [53699:0x7a13694000] 15696 ms: Incremental Mark-Compact (reduce) 4088.2 (4096.2) -> 4083.0 (4088.4) MB, pooled: 0.0 MB, 371.37 / 0.00 ms (+ 0.1 ms in 90 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 381 ms) (average
Fatal JavaScript out of memory: Ineffective mark-compacts near heap limit
==== C stack trace ===============================
0 swamp 0x0000000103347e14 uv_unref + 13258976
1 swamp 0x000000010334b7d8 uv_unref + 13273764
2 swamp 0x0000000103343f28 uv_unref + 13242868
3 swamp 0x00000001033adce4 uv_unref + 13676464
4 swamp 0x000000010358fa78 uv_unref + 15650116
5 swamp 0x000000010358f254 uv_unref + 15648032
6 swamp 0x000000010358de48 uv_unref + 15642900
7 swamp 0x000000010350a7f8 uv_unref + 15104708
8 swamp 0x00000001039767bc uv_unref + 19741320
9 swamp 0x000000010481f26c uv_unref + 35112248
10 ??? 0x000000011cb30840 0x0 + 4776462400
11 ??? 0x000000011cb22d4c 0x0 + 4776406348
12 ??? 0x000000011cb2fe18 0x0 + 4776459800
13 ??? 0x000000011cb35490 0x0 + 4776481936
14 ??? 0x000000011cb2ff40 0x0 + 4776460096
15 ??? 0x000000011cb22d4c 0x0 + 4776406348
16 ??? 0x000000011cb2fe18 0x0 + 4776459800
17 ??? 0x000000011cb35490 0x0 + 4776481936
18 ??? 0x000000011cb2ff40 0x0 + 4776460096
19 ??? 0x000000011cb35490 0x0 + 4776481936
20 ??? 0x000000011cb2ff40 0x0 + 4776460096
21 ??? 0x000000011cb35490 0x0 + 4776481936
22 ??? 0x000000011cb2ff40 0x0 + 4776460096
23 ??? 0x000000011cb35490 0x0 + 4776481936
24 ??? 0x000000011cb2ff40 0x0 + 4776460096
25 ??? 0x000000011cb35490 0x0 + 4776481936
26 ??? 0x000000011cb2ff40 0x0 + 4776460096
27 ??? 0x000000011cb35490 0x0 + 4776481936
28 ??? 0x000000011cb2ff40 0x0 + 4776460096
29 ??? 0x000000011cb22d4c 0x0 + 4776406348
30 ??? 0x000000011cb2fe18 0x0 + 4776459800
31 ??? 0x000000011cb35490 0x0 + 4776481936
32 ??? 0x000000011cb2ff40 0x0 + 4776460096
33 ??? 0x000000011cb22d4c 0x0 + 4776406348
34 ??? 0x000000011cb2fe18 0x0 + 4776459800
35 ??? 0x000000011cb35490 0x0 + 4776481936
36 ??? 0x000000011cb2ff40 0x0 + 4776460096
37 ??? 0x000000011ca98748 0x0 + 4775839560
38 ??? 0x000000011ca6e230 0x0 + 4775666224
39 swamp 0x00000001047bb40c uv_unref + 34703064
40 ??? 0x000000011ca975c0 0x0 + 4775835072
41 ??? 0x000000011cae2828 0x0 + 4776142888
42 swamp 0x00000001047b8884 uv_unref + 34691920
43 swamp 0x00000001048a3218 uv_unref + 35652836
44 swamp 0x00000001047a766c uv_unref + 34621752
45 swamp 0x0000000104776778 uv_unref + 34421316
46 swamp 0x00000001034bc340 uv_unref + 14784012
47 swamp 0x00000001034bcc08 uv_unref + 14786260
48 swamp 0x00000001034bcd40 uv_unref + 14786572
49 swamp 0x0000000103508c90 uv_unref + 15097692
50 swamp 0x0000000103508bc8 uv_unref + 15097492
51 swamp 0x0000000102301ac0 uv_default_loop + 24428
52 swamp 0x000000010230054c uv_default_loop + 18936
53 swamp 0x000000010211b41c uv_free_cpu_info + 4624
54 swamp 0x00000001021302ec uv_free_cpu_info + 90336
55 swamp 0x00000001021182d0 swamp + 17104
56 swamp 0x0000000102123058 uv_free_cpu_info + 36428
57 swamp 0x0000000102131660 uv_free_cpu_info + 95316
58 swamp 0x000000010211f138 uv_free_cpu_info + 20268
59 swamp 0x0000000102133a8c uv_free_cpu_info + 104576
60 dyld 0x0000000194c63e88 start + 6688A second instance of the same crash, captured from swamp workflow run daily (process 70733, ended with trace trap):
<--- Last few GCs --->
[70733:0x7b49694000] 417760 ms: Incremental Mark-Compact (reduce) 4032.4 (4057.4) -> 3946.1 (3971.1) MB, pooled: 0.0 MB, 62.33 / 0.00 ms (+ 141.7 ms in 29 steps since start of marking, biggest step 5.0 ms, walltime since start of marking 210 ms) (averag
Fatal JavaScript out of memory: Ineffective mark-compacts near heap limit
==== C stack trace ===============================
0 swamp 0x0000000101d4be14 uv_unref + 13258976
1 swamp 0x0000000101d4f7d8 uv_unref + 13273764
2 swamp 0x0000000101d47f28 uv_unref + 13242868
3 swamp 0x0000000101db1ce4 uv_unref + 13676464
4 swamp 0x0000000101f93a78 uv_unref + 15650116
5 swamp 0x0000000101f93254 uv_unref + 15648032
6 swamp 0x0000000101f91e48 uv_unref + 15642900
7 swamp 0x0000000101f0e7f8 uv_unref + 15104708
8 swamp 0x000000010237a7bc uv_unref + 19741320
9 swamp 0x000000010322326c uv_unref + 35112248
10 ??? 0x000000011b7e6a0c 0x0 + 4756236812
11 ??? 0x000000011b940b08 0x0 + 4757654280
12 ??? 0x000000011b94201c 0x0 + 4757659676
13 ??? 0x000000011b940e20 0x0 + 4757655072
14 ??? 0x000000011b932cd0 0x0 + 4757597392
15 ??? 0x000000011b941064 0x0 + 4757655652
16 ??? 0x000000011b94201c 0x0 + 4757659676
17 ??? 0x000000011b940e20 0x0 + 4757655072
18 ??? 0x000000011b94201c 0x0 + 4757659676
19 ??? 0x000000011b940e20 0x0 + 4757655072
20 ??? 0x000000011b94201c 0x0 + 4757659676
21 ??? 0x000000011b940e20 0x0 + 4757655072
22 ??? 0x000000011b94201c 0x0 + 4757659676
23 ??? 0x000000011b940e20 0x0 + 4757655072
24 ??? 0x000000011b94201c 0x0 + 4757659676
25 ??? 0x000000011b940e20 0x0 + 4757655072
26 ??? 0x000000011b94201c 0x0 + 4757659676
27 ??? 0x000000011b940e20 0x0 + 4757655072
28 ??? 0x000000011b932cd0 0x0 + 4757597392
29 ??? 0x000000011b941064 0x0 + 4757655652
30 ??? 0x000000011b94201c 0x0 + 4757659676
31 ??? 0x000000011b940e20 0x0 + 4757655072
32 ??? 0x000000011bb3f724 0x0 + 4759746340
33 ??? 0x000000011bb3c020 0x0 + 4759732256
34 ??? 0x000000011bb3e880 0x0 + 4759742592
35 ??? 0x000000011bb3c33c 0x0 + 4759733052
36 ??? 0x000000011b8d6fc8 0x0 + 4757221320
37 ??? 0x000000011b8d654c 0x0 + 4757218636
38 ??? 0x000000011bb0d748 0x0 + 4759541576
39 swamp 0x00000001031bc884 uv_unref + 34691920
40 swamp 0x00000001032a7218 uv_unref + 35652836
41 swamp 0x00000001031ab66c uv_unref + 34621752
42 swamp 0x000000010317a778 uv_unref + 34421316
43 swamp 0x0000000101ec0340 uv_unref + 14784012
44 swamp 0x0000000101ec0c08 uv_unref + 14786260
45 swamp 0x0000000101ec0d40 uv_unref + 14786572
46 swamp 0x0000000101f0cc90 uv_unref + 15097692
47 swamp 0x0000000101f0cbc8 uv_unref + 15097492
48 swamp 0x0000000100d05ac0 uv_default_loop + 24428
49 swamp 0x0000000100d0454c uv_default_loop + 18936
50 swamp 0x0000000100b1f41c uv_free_cpu_info + 4624
51 swamp 0x000000010b342ec uv_free_cpu_info + 90336
52 swamp 0x0000000100b1c2d0 swamp + 17104
53 swamp 0x0000000100b27058 uv_free_cpu_info + 36428
54 swamp 0x0000000100b35660 uv_free_cpu_info + 95316
55 swamp 0x0000000100b23138 uv_free_cpu_info + 20268
56 swamp 0x0000000100b37a8c uv_free_cpu_info + 104576
57 dyld 0x000000018667be88 start + 6688[1] 70733 trace trap swamp workflow run daily
Part 2: The crash is not shown as a failure
When the OOM crash kills the process, the run does not move to failed status. It stays in running status. This is what I see:
- The last line of my run log is a normal
INFline mid-workflow. No error, warning, or exception comes before it. Nothing comes after. - The OS process is absent. The PID no longer exists.
swamp run history --activeshows the run asrunning [STALE]. The status uses heartbeat age only.swamp workflow run liststill showsstatus: running.swamp run doctoris the only command that shows me the problem. It shows "stale", not a crash.swamp run doctor --fixremoves the stale run. swamp produces no failed-status record.
I recommend that, when the workflow process dies before it reaches a terminal state, the run move to failed or crashed status and record the last-known step with an "unexpected process exit" marker. For me, that would mean:
swamp workflow run listand history show the run as failed, not as running.- swamp tells the operator that the work did not complete, so I do not need to run
swamp run doctorto find this. - Downstream automation (cron loops, CI) can detect the failure and retry, and does not assume that the run is still in progress.
The current behavior is the worst case for an unattended workflow, in my experience: the run dies in silence and stays in running status.
Part 3: No native per-process isolation and the shell workaround
It appears there is no native, daemon-free, on-demand way to put each step of a long workflow into its own process.
type: workflow(nested sub-workflows) andforEachboth run in-process in the parent engine, from what I can tell. The execution-semantics doc states that there is "no async, detached, or fire-and-forget mode" forswamp workflow run. A "separate run" for a nested workflow is a separate run record, not a separate process. So the OOM still accumulates across all iterations in one process. I verified this empirically: a parent that invokes a child viatype: workflowruns the child in the same OS process as the parent (I sampled one swamp process throughout the child run, even though the child is tracked as a separate run in history).- The only native primitive that makes separate OS processes, as far as I know, is worker placement. It needs the
swamp serveorchestrator. The doc states: "Placement requires running underswamp serve; a placed step outside it fails." I also confirmed that the step-leveldriverfield (an older per-step isolation mechanism) is removed in the current build —swamp workflow validaterejects it with: "The 'driver' field has been removed — execution drivers are replaced by remote execution (see design/remote-execution.md). Remove the field; for isolation, run a containerized worker and use step 'labels' placement." So worker placement viaswamp serveis the only native isolation path I can find.
I hit the OOM and want per-process isolation. To get it without swamp serve, I have to run an external shell loop of swamp workflow run commands. I recognize this is non-native and conflicts with swamp guidance, which tells operators to use swamp fan-out methods and not shell loops. The OOM and the missing isolation primitive make me bypass swamp to work around a swamp crash.
I propose a native primitive that runs each iteration or sub-workflow in its own process, on demand, with no daemon. I suspect it can fix this and remove the need for the shell workaround.
Steps to Reproduce
- I run
swamp workflow run <workflow> --log. The workflow runs manymodel_methodjobs in one process (parallel parse of 17 groups, then sequential extraction). - I wait several minutes. The run progresses normally through parse and into extract, and it writes data.
- The process crashes mid-workflow with an OOM (
Fatal JavaScript out of memory: Ineffective mark-compacts near heap limit). The run prints or logs no error. The process exits withtrace trap. - I run
swamp run history --active. It showsrunning [STALE]. - I run
swamp workflow run list. It showsstatus: running. - I run
swamp run doctor --fix. It removes the stale run. swamp produces no failed-status record.
Environment
- swamp version: swamp 20260815.023608.0-sha.a648c130
- OS: macOS, Apple silicon (M-series), 32 GB RAM
- Workflow shape: a set of parallel
model_methodparse jobs. A sequential chain ofmodel_methodextraction jobs follows. The jobs run in one DAG.
Workaround in place
My workaround splits the monolithic workflow into one workflow per group. An external shell loop runs each as its own swamp workflow run process. Each process handles one group and exits. State cannot accumulate across groups, so the OOM does not occur. All per-group runs succeed, where the monolithic run crashed mid-workflow with an OOM. The workaround is effective but non-native. I know it is the shell-bypass pattern that swamp guidance tells operators not to use. I suggest a native per-process-on-demand primitive can remove the need for it.
Triaged
Click a lifecycle step above to view its details.
stack72 commented 8/17/2026, 8:15:52 PM
Hi @jesserobbins - was it a workflow or a model you were running here? I am trying to track down the critical path to help
Paul
jesserobbins commented 8/21/2026, 12:18:38 AM
it's a workflow that parses 17 WhatsApp groups, runs them through a multi stage parsing and extraction flow, organizes them and reports back.
jesserobbins commented 8/21/2026, 12:26:45 AM
<--- Last few GCs --->
[70733:0x7b49694000] 417760 ms: Incremental Mark-Compact (reduce) 4032.4 (4057.4) -> 3946.1 (3971.1) MB, pooled: 0.0 MB, 62.33 / 0.00 ms (+ 141.7 ms in 29 steps since start of marking, biggest step 5.0 ms, walltime since start of marking 210 ms) (averag
Fatal JavaScript out of memory: Ineffective mark-compacts near heap limit
==== C stack trace ===============================
0 swamp 0x0000000101d4be14 uv_unref + 13258976
1 swamp 0x0000000101d4f7d8 uv_unref + 13273764
2 swamp 0x0000000101d47f28 uv_unref + 13242868
3 swamp 0x0000000101db1ce4 uv_unref + 13676464
4 swamp 0x0000000101f93a78 uv_unref + 15650116
5 swamp 0x0000000101f93254 uv_unref + 15648032
6 swamp 0x0000000101f91e48 uv_unref + 15642900
7 swamp 0x0000000101f0e7f8 uv_unref + 15104708
8 swamp 0x000000010237a7bc uv_unref + 19741320
9 swamp 0x000000010322326c uv_unref + 35112248
10 ??? 0x000000011b7e6a0c 0x0 + 4756236812
11 ??? 0x000000011b940b08 0x0 + 4757654280
12 ??? 0x000000011b94201c 0x0 + 4757659676
13 ??? 0x000000011b940e20 0x0 + 4757655072
14 ??? 0x000000011b932cd0 0x0 + 4757597392
15 ??? 0x000000011b941064 0x0 + 4757655652
16 ??? 0x000000011b94201c 0x0 + 4757659676
17 ??? 0x000000011b940e20 0x0 + 4757655072
18 ??? 0x000000011b94201c 0x0 + 4757659676
19 ??? 0x000000011b940e20 0x0 + 4757655072
20 ??? 0x000000011b94201c 0x0 + 4757659676
21 ??? 0x000000011b940e20 0x0 + 4757655072
22 ??? 0x000000011b94201c 0x0 + 4757659676
23 ??? 0x000000011b940e20 0x0 + 4757655072
24 ??? 0x000000011b94201c 0x0 + 4757659676
25 ??? 0x000000011b940e20 0x0 + 4757655072
26 ??? 0x000000011b94201c 0x0 + 4757659676
27 ??? 0x000000011b940e20 0x0 + 4757655072
28 ??? 0x000000011b932cd0 0x0 + 4757597392
29 ??? 0x000000011b941064 0x0 + 4757655652
30 ??? 0x000000011b94201c 0x0 + 4757659676
31 ??? 0x000000011b940e20 0x0 + 4757655072
32 ??? 0x000000011bb3f724 0x0 + 4759746340
33 ??? 0x000000011bb3c020 0x0 + 4759732256
34 ??? 0x000000011bb3e880 0x0 + 4759742592
35 ??? 0x000000011bb3c33c 0x0 + 4759733052
36 ??? 0x000000011b8d6fc8 0x0 + 4757221320
37 ??? 0x000000011b8d654c 0x0 + 4757218636
38 ??? 0x000000011bb0d748 0x0 + 4759541576
39 swamp 0x00000001031bc884 uv_unref + 34691920
40 swamp 0x00000001032a7218 uv_unref + 35652836
41 swamp 0x00000001031ab66c uv_unref + 34621752
42 swamp 0x000000010317a778 uv_unref + 34421316
43 swamp 0x0000000101ec0340 uv_unref + 14784012
44 swamp 0x0000000101ec0c08 uv_unref + 14786260
45 swamp 0x0000000101ec0d40 uv_unref + 14786572
46 swamp 0x0000000101f0cc90 uv_unref + 15097692
47 swamp 0x0000000101f0cbc8 uv_unref + 15097492
48 swamp 0x0000000100d05ac0 uv_default_loop + 24428
49 swamp 0x0000000100d0454c uv_default_loop + 18936
50 swamp 0x0000000100b1f41c uv_free_cpu_info + 4624
51 swamp 0x0000000100b342ec uv_free_cpu_info + 90336
52 swamp 0x0000000100b1c2d0 swamp + 17104
53 swamp 0x0000000100b27058 uv_free_cpu_info + 36428
54 swamp 0x0000000100b35660 uv_free_cpu_info + 95316
55 swamp 0x0000000100b23138 uv_free_cpu_info + 20268
56 swamp 0x0000000100b37a8c uv_free_cpu_info + 104576
57 dyld 0x000000018667be88 start + 6688[1] 70733 trace trap swamp workflow run daily
Sign in to post a ripple.