Application memory description

From WowWiki
Jump to navigation Jump to search

Wasm

ApplicaionMemory.png

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.