You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* OOM retrying on larger machines
* Create forty-windows-shop.md
* Update forty-windows-shop.md
* Only retry again if the machine is different from the original
Sometimes you might see one of your runs fail with an "Out Of Memory" error.
32
+
33
+
> TASK_PROCESS_OOM_KILLED. Your task ran out of memory. Try increasing the machine specs. If this doesn't fix it there might be a memory leak.
34
+
35
+
If this happens regularly you need to either optimize the memory-efficiency of your code, or increase the machine.
36
+
37
+
### Retrying with a larger machine
38
+
39
+
If you are seeing rare OOM errors, you can add a setting to your task to retry with a large machine if you get an OOM error:
40
+
41
+
```ts /trigger/heavy-task.ts
42
+
exportconst yourTask =task({
43
+
id: "your-task",
44
+
machine: "medium-1x",
45
+
retry: {
46
+
outOfMemory: {
47
+
machine: "large-1x",
48
+
},
49
+
},
50
+
run: async (payload:any, { ctx }) => {
51
+
//...
52
+
},
53
+
});
54
+
```
55
+
56
+
<Note>
57
+
This will only retry the task if you get an OOM error. It won't permanently change the machine that a new run starts on, so if you consistently see OOM errors you should change the machine in the `machine` property.
0 commit comments