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
Copy file name to clipboardExpand all lines: sources/platform/actors/development/actor_definition/dynamic_actor_memory/index.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,14 @@ import TabItem from '@theme/TabItem';
14
14
Dynamic Actor memory allows Actor to automatically adjust its memory allocation based on the input and run options. Instead of always using a fixed memory value, Actor can use just the right amount of memory for each run.
15
15
16
16
Currently, Actors often use a static default memory, but the optimal memory usually depends on the input size:
17
+
17
18
- A small input (for example, 10 URLs) might run fine on 512 MB.
18
19
- A large input (for example, 1,000 URLs) could require 4 GB or more to run efficiently.
19
20
20
21
_Setting a single default value either wastes resources on small runs or slows down execution for large ones._ Dynamic memory solves this by calculating the required memory just before the run starts, based on the actual input and run options.
21
22
22
23
This helps:
24
+
23
25
-_Optimize performance_ for large inputs (more memory for bigger tasks).
24
26
-_Reduce costs_ for small runs (less memory when it’s not needed).
25
27
-_Provide better user experience_, so users get optimal performance without having to manually configure memory.
@@ -28,7 +30,7 @@ This helps:
28
30
29
31
_This feature does not change memory while the Actor is running._
30
32
31
-
Memory is calculated once, right before the run begins. Each new run (for example, when the user provides different input) starts with memory calculated by the expression.
33
+
Memory is calculated once, right before the run begins. Each new run (for example, when the user provides different input) starts with memory calculated by the expression.
32
34
33
35
Users can still override it manually for each run.
34
36
@@ -156,8 +158,9 @@ If the calculation results in an error, the Actor will start with a fixed defaul
156
158
```
157
159
158
160
Explanation:
159
-
- `get(input, 'startUrls.length', 1)` → Safely reads length of `startUrls` array; defaults to 1 if not provided.
160
-
- Allocates 512 MB per URL.
161
+
162
+
- `get(input, 'startUrls.length', 1)` → Safely reads length of `startUrls` array; defaults to 1 if not provided.
0 commit comments