Skip to content

Commit 7ab0ccc

Browse files
committed
fix: lint
1 parent 9e853c8 commit 7ab0ccc

File tree

1 file changed

+18
-10
lines changed
  • sources/platform/actors/development/actor_definition/dynamic_actor_memory

1 file changed

+18
-10
lines changed

sources/platform/actors/development/actor_definition/dynamic_actor_memory/index.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import TabItem from '@theme/TabItem';
1414
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.
1515

1616
Currently, Actors often use a static default memory, but the optimal memory usually depends on the input size:
17+
1718
- A small input (for example, 10 URLs) might run fine on 512 MB.
1819
- A large input (for example, 1,000 URLs) could require 4 GB or more to run efficiently.
1920

2021
_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.
2122

2223
This helps:
24+
2325
- _Optimize performance_ for large inputs (more memory for bigger tasks).
2426
- _Reduce costs_ for small runs (less memory when it’s not needed).
2527
- _Provide better user experience_, so users get optimal performance without having to manually configure memory.
@@ -28,7 +30,7 @@ This helps:
2830

2931
_This feature does not change memory while the Actor is running._
3032

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.
3234

3335
Users can still override it manually for each run.
3436

@@ -156,8 +158,9 @@ If the calculation results in an error, the Actor will start with a fixed defaul
156158
```
157159

158160
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.
163+
- Allocates 512 MB per URL.
161164

162165
</TabItem>
163166
<TabItem value="Conditional logic" label="Conditional logic">
@@ -169,8 +172,9 @@ If the calculation results in an error, the Actor will start with a fixed defaul
169172
```
170173

171174
Explanation:
172-
- `get(input, 'scrapeDetailed', false)` → Reads a boolean flag from `input`; defaults to `false`.
173-
- `? 4096 : 1024` → If `scrapeDetailed` is `true`, allocate 4096 MB; otherwise, allocate 1024 MB.
175+
176+
- `get(input, 'scrapeDetailed', false)` → Reads a boolean flag from `input`; defaults to `false`.
177+
- `? 4096 : 1024` → If `scrapeDetailed` is `true`, allocate 4096 MB; otherwise, allocate 1024 MB.
174178

175179
</TabItem>
176180
<TabItem value="Variable assignment" label="Variable assignment">
@@ -182,10 +186,12 @@ If the calculation results in an error, the Actor will start with a fixed defaul
182186
reviewsMultiplier = max(get(input, 'maxReviews', 1) / 10, 1);
183187
urlsCount * reviewsMultiplier * 128
184188
```
189+
185190
Explanation:
186-
- `urlsCount` → Number of URLs to process.
187-
- `reviewsMultiplier` → Adjusts memory based on the number of reviews; ensures at least 1.
188-
- `urlsCount * reviewsMultiplier * 128` → Final memory allocation, scaling with both URLs and review count.
191+
192+
- `urlsCount` → Number of URLs to process.
193+
- `reviewsMultiplier` → Adjusts memory based on the number of reviews; ensures at least 1.
194+
- `urlsCount * reviewsMultiplier * 128` → Final memory allocation, scaling with both URLs and review count.
189195

190196
</TabItem>
191197
<TabItem value="Double-brace variables" label="Double-brace variables">
@@ -197,9 +203,11 @@ If the calculation results in an error, the Actor will start with a fixed defaul
197203
```
198204

199205
Explanation:
200-
- `{{input.itemsToProcess}}` → Reads the number of items to process.
201-
- Allocates 64 MB per item.
206+
207+
- `{{input.itemsToProcess}}` → Reads the number of items to process.
208+
- Allocates 64 MB per item.
202209
</TabItem>
210+
203211
</Tabs>
204212

205213
### Testing expressions

0 commit comments

Comments
 (0)