【米尔-MYD-LR3568-GK开发板--试用评测】N.发布内存使用情况
发布总内存大小,代码如下:!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192700ncdyclw8ewyhgtlk.png)
代码说明:
1,用popen 打开一个pipe stream
2,从中读取数据
3,关闭 pipe stream。必须关闭,不然会造成内存泄露,运行时间长了,导致段错误,程序崩溃
4,读取的的是字符串,转换为数值
5,单位转换
6,发布数据
发布内存空闲大小,代码如下:
!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192722w1ptp3yhpd33q80h.png)
发布内存使用率,使用率基于以上内存空闲和内存总量数据计算:
!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192729fsffc1sc4skkfzcs.png)
以下是开发板端 log:
!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192736imj77zn76u04wtd7.png)
!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192739snncc118a81lif2f.png)
内存使用量是 19.343%
!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192747zh1i1vu8wyg18juy.png)
发布成功,云端的应答:
!(https://www.eefocus.com/forum/data/attachment/forum/202411/20/192754coq12327zstqcstc.png)
页:
[1]