0

Is it possible to allocate memory without the mmap2 call?

I was working on A10 board video player, where I have a huge memory leak. possibly in each frame displayer. There is a library libvecore which handles system call and we don't have the source.

I know that A10 is not common subject so my question is not for A10 but for kernel memory alloc.

I try to trace the program with: strace -e mmap2 ./VideoPlayer.

But I'm surprised with the result. It's not calling mmap2 while video player it calls only on startup.

But at the same time I see memory usage from TOP I can see VideoPlayer is contentiously allocating memory and it almost eats up 300 MB in 3 min.

So should I consider that the memory leak is in the kernel? Or there is any other call to allocate memory dynamically?

pb2q
  • 58,613
  • 19
  • 146
  • 147

1 Answers1

3

Yes, the normal way memory is allocated is via the brk system call.

R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711
  • Thanks for update. I think brk is used to realloc memory right?. I have traced brk also but there is no call of brk while playing video. Any other function ? – Piyush Verma Sep 13 '12 at 07:03
  • How are you determining that the application is allocating memory? I suspect you're wrong and the kernel is just caching data from the filesystem. The output of the `free` command is utterly useless for determining memory usage. – R.. GitHub STOP HELPING ICE Sep 13 '12 at 12:02