github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/en/docs/plugins/memory_app.md (about) 1 2 --- 3 title: "Memory app" 4 linkTitle: "memory app" 5 date: 2021-10-20 6 description: > 7 8 --- 9 10 {{< figure src="/smart-home/memory_app.png" width="300" >}} 11 12 13 14 15 16 In the **Smart Home** system, there is a "memory_app" plugin that provides the display of application memory parameters. This plugin allows you to obtain information about various characteristics of the application memory. Here are some of these parameters: 17 18 1. `alloc`: The `alloc` parameter displays the amount of memory allocated for the application in bytes. It indicates the current value of allocated memory. 19 20 2. `heap_alloc`: The `heap_alloc` parameter shows the amount of memory allocated in the heap for the application in bytes. This value indicates the current allocation of memory in the heap. 21 22 3. `total_alloc`: The `total_alloc` parameter indicates the total amount of memory allocated for the application since its launch in bytes. It reflects the overall memory volume allocated to the application. 23 24 4. `sys`: The `sys` parameter shows the amount of system memory used by the application. It indicates the current value of system memory usage. 25 26 5. `num_gc`: The `num_gc` parameter displays the number of garbage collections that have occurred since the application was launched. 27 28 6. `last_gc`: The `last_gc` parameter indicates the time of the last garbage collection. It provides information about the time of the last garbage collection performed in the application. 29 30 Here's an example of using the "memory_app" plugin to retrieve application memory parameters: 31 32 ```javascript 33 const memoryParams = EntityGetAttributes('memory.memory') 34 console.log(memoryParams.alloc); 35 console.log(memoryParams.heap_alloc); 36 console.log(memoryParams.total_alloc); 37 console.log(memoryParams.sys); 38 console.log(memoryParams.num_gc); 39 console.log(memoryParams.last_gc); 40 ``` 41 42 You can use these parameters to display information about the application memory in your **Smart Home** project.