[MPlayer-dev-eng] possible bug in demux_mov.c

Arpi arpi at thot.banki.hu
Mon Apr 21 22:13:18 CEST 2003


Hi,

> > also note, that it doesn't even happen on VM systems, as there are 2GB
> > VM, whiel you have actually a lot less plhisical memory, so your app
> > will be killed by kernel's OOM before your app gets any error of malloc()
> > (you can even malloc() 2GB, it will be allocated really when you start use
> > (address) it, malloc won't fail even if you have only 8MB ram)
> 
> That's plain wrong. Maybe you're confusing it with mmap?

no

-------------
int main(){
void* p1=malloc(251*1024*1024);
void* p2=malloc(251*1024*1024);
void* p3=malloc(251*1024*1024);
void* p4=malloc(251*1024*1024);
printf("p1=%p\n",p1);
printf("p2=%p\n",p2);
printf("p3=%p\n",p3);
printf("p4=%p\n",p4);
memset(p1,0x77,251*1024*1024);
memset(p2,0x77,251*1024*1024);
memset(p3,0x77,251*1024*1024);
memset(p4,0x77,251*1024*1024);
}
-------------

root at arpi:~/mem# free
             total       used       free     shared    buffers     cached
Mem:        512868     103092     409776          0      11696      14316
-/+ buffers/cache:      77080     435788
Swap:            0          0          0

root at arpi:~/mem# ./a.out
p1=0x4013a008
p2=0x4fc3b008
p3=0x5f73c008
p4=0x6f23d008
Terminated

root at arpi:~/mem# dmesg | tail -n 1
Out of Memory: Killed process 1742 (a.out).


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list