Chris Liang(deleted)
|
showmem showing weird memory information
|
Chris Liang(deleted)
04/11/2019 11:08 AM
post119653
|
showmem showing weird memory information
Hi,
I want to check the program memory usage, data/bss, heap
I am using showmem -P to get the process memory usage
In my program, I create a large static buffer:
static char testBuf[10240]; // 10k bytes buffer
memset(testBuf, 0, sizeof(testBuf)); // set to zero
open this program in momentics, it shows
.bss 0x00002800 testBuf
total .bss 0x000152e0
this is correct, testBuf is static variable and it should belong to .bss section
When I ran this program in qnx 6.4.1, using showmem
it gives
Total Code Data Heap Stack Other
4382720 1540096 81920 2752512 8192 0
Now, I remove the testBuf. after compiled,
total .bss 0x00012ae0, so the difference is 0x2800 which makes sense.
However, when I ran the new program again, check the showmem
it shows:
Total Code Data Heap Stack Other
4374528 1540096 81920 2744320 8192 0
I am expecting Data section reduced, however, it is not and the heap section reduced.
Does it means .bss includes in the Heap section in showmem??
Thanks
|
|
|