ubuntu ver : 20.04
gcc ver : gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
target : jetson board (aarch64 architecture)
system info. : 5.10.104-tegra
hello.
I have a question regarding the use of dmalloc.
The desired task is to compile the test.c source code and check memory usage(or memory leakage) using dmalloc. At this time, the dmalloc-related git clone process I applied is explained as follows.
- git clone https://github.com/j256/dmalloc.git
- ./configure
- make && make install
-
dmalloc settings
- dmalloc -l ./logfile -i 100 high > dmalloc_setup (or dmalloc -l /home/jetson/profile_test1/dmalloc/logfile -i 100 high > dmalloc_setup)
- source dmalloc_setup
- echo $DMALLOC_OPTIONS
-
run
- gcc -g -DDMALLOC -o test test.c -ldmalloc
- ./test
- cat logfile
The code in my test.c is as follows:
#include <stdio.h>
#include <stdlib.h>
#ifdef DMALLOC
#include <dmalloc.h>
#endif
int main() {
char *ch_p = (char *)malloc(10);
for (int j = 0; j < 2; j++)
malloc(100); // no free
calloc(16, 16); // no free
return 0;
}
But, at this time, the logfile is not created. Any problem?