Difference between revisions of "Application memory description"
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==Wasm== | ==Wasm== | ||
+ | [[File:ApplicaionMemory.png|200px|left]] | ||
===Stack=== | ===Stack=== | ||
A 10 KB stack is allocated for any application. It remains fixed during the application's execution and cannot be increased. If an application exceeds this stack limit, it will be terminated and "Stack low" screen will be displayed. | A 10 KB stack is allocated for any application. It remains fixed during the application's execution and cannot be increased. If an application exceeds this stack limit, it will be terminated and "Stack low" screen will be displayed. | ||
Line 6: | Line 7: | ||
===Cache=== | ===Cache=== | ||
The 256 KB block remains fixed during the application's execution and cannot be increased. From this block, the virtual machine allocates memory for runtime compilation of Wasm code in pages of 32,768 bytes. If the application reaches this limit, it will be terminated and a "Cache low" error screen will be displayed. | The 256 KB block remains fixed during the application's execution and cannot be increased. From this block, the virtual machine allocates memory for runtime compilation of Wasm code in pages of 32,768 bytes. If the application reaches this limit, it will be terminated and a "Cache low" error screen will be displayed. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
==Pawn== | ==Pawn== | ||
The '''stack''' and '''heap''' are calculated during the application's build process and allocated at startup in the required amounts. The only limitation is that the '''stack''' and '''heap''' combined must occupy less than 1.2 MB. | The '''stack''' and '''heap''' are calculated during the application's build process and allocated at startup in the required amounts. The only limitation is that the '''stack''' and '''heap''' combined must occupy less than 1.2 MB. |
Latest revision as of 12:27, 12 June 2024
Wasm
Stack
A 10 KB stack is allocated for any application. It remains fixed during the application's execution and cannot be increased. If an application exceeds this stack limit, it will be terminated and "Stack low" screen will be displayed.
Heap
By default, the HEAP size is 131,072 bytes. Its size does not change automatically and must be a multiple of 65,536 bytes. You can modify it during application build time using the INITIAL_MEMORY flag with the required number of bytes in multiples of 65,536. For example, setting INITIAL_MEMORY=262144 will increase the HEAP up to 262,144 bytes. If an application reaches the HEAP limit, it will be terminated and "Heap low" screen will be displayed.
Cache
The 256 KB block remains fixed during the application's execution and cannot be increased. From this block, the virtual machine allocates memory for runtime compilation of Wasm code in pages of 32,768 bytes. If the application reaches this limit, it will be terminated and a "Cache low" error screen will be displayed.
Pawn
The stack and heap are calculated during the application's build process and allocated at startup in the required amounts. The only limitation is that the stack and heap combined must occupy less than 1.2 MB.