Binary size
A typical binary application has four main sections:
- .text - contains the compiled code
- .rodata - contains the read only data
- .data - contains the initialized read / write data
- .bss - contains the uninitialized read / write data
The space occupied by the application is the sum of the first three sections, since .bss is simply initialized with zero. The binary size chart shows the sum of the first three sections which is the required flash memory (disk) space for IoT.js.
There are two types of build created. The first is a minimal-profile build that contains only the neccessary modules IoT.js requires. The second is a target and test specific profile build, that contains all the modules that the tests require.
On TizenRT operating system the system and all applications are compiled into a single binary. The space consumed by IoT.js is calculated from the linker map file generated by the compiler.
Memory measurement setup
IoT.js has three major components:
- IoT.js core
- libtuv
- JerryScript
The core and libtuv uses the system malloc for allocating memory. However, JerryScript has an own optimized memory allocator with zero allocation overhead (i.e. does not allocate extra space for allocated blocks), so the whole memory area can be allocated by the application. The JerryScript allocator uses a contiguous memory block called JerryScript heap which size can be specified at compile time. The test system uses a 60 KByte JerryScript heap which is enough to run the IoT.js tests.
The average memory chart shows the average memory consumption which is computed by adding the memory allocated by malloc and JerryScript plus the stack size.
The average memory consumption of the components above on 10th of November 2017 follows:
- JerryScript heap: 26486 Bytes
- System heap: 3632 Bytes
- Stack: 4836 Bytes
The percentage of these components can be seen on Figure 1 above.
The minimum memory requirement chart shows the minimum memory settings of the test system when all tests are executed. Any system with these resources are capable of running with the test system:
- JerryScript heap: 57344 Bytes (56 KB)
- System heap: 15808 Bytes
- Stack: 7800 Bytes
The percentage of these components can be seen on Figure 2 above.