|
From: Lloyd <ll...@cd...> - 2007-05-24 05:47:42
|
Hi, I have written a program in Linux. It opens a file and maps it to memory using mmap and unmaps and closes the file. I am using a custom written data structure as well in the program. There is no leak associated with the data structure. But some ware a big leak is present. (I dont know where) I assume it could be with mmap and munmap... Because as I open more and more files, the leak gradually increases to megabytes! but for each mam,p the munmap is called correspondingly. And the range which I give to unmap is correct. Where could be the source of problem? Even after the program exit the memory consumption remains same (not reducted to the program startup state). I see this with the aid of system monitoring tool.. please help me... Thanks and Regards, Lloyd ______________________________________ Scanned and protected by Email scanner |
|
From: Jonathan W. <jon...@gm...> - 2007-05-25 06:28:33
|
Hi, Maybe you should use valgrind to test your program for leaks (compiling with debugging symbols should help you get a digestable log) Jonathan On 5/24/07, Lloyd <ll...@cd...> wrote: > > Hi, > I have written a program in Linux. > It opens a file and maps it to memory using mmap and unmaps and closes > the file. I am using a custom written data structure as well in the > program. There is no leak associated with the data structure. But some > ware a big leak is present. (I dont know where) I assume it could be > with mmap and munmap... Because as I open more and more files, the leak > gradually increases to megabytes! but for each mam,p the munmap is > called correspondingly. And the range which I give to unmap is correct. > > Where could be the source of problem? Even after the program exit the > memory consumption remains same (not reducted to the program startup > state). I see this with the aid of system monitoring tool.. > > please help me... > > Thanks and Regards, > Lloyd > > > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > -- <Morpheus> linux, c'est une question de VI ou de MORE |
|
From: Lloyd <ll...@cd...> - 2007-05-25 06:50:33
|
Thank you Jonathan. I tried using valgrind, but my program uses wxWidgets (a GUI library). The out put of valgrind is unreadable and not understandable for me :( It shows lots of lines as output When I executed my program more and more, at the first stages (first few 100 files) of file mapping no leak is shown, but when I go further, for each 10 or 15 files 1MB to 3MB of leak is shown! I am not understanding whats happening. Is there any chance of going something in the OS? Thank you, Lloyd On Fri, 2007-05-25 at 08:28 +0200, Jonathan Winterflood wrote: > Hi, > > Maybe you should use valgrind to test your program for leaks > (compiling with debugging symbols should help you get a digestable > log) > > Jonathan > > On 5/24/07, Lloyd <ll...@cd...> wrote: > Hi, > I have written a program in Linux. > It opens a file and maps it to memory using mmap and unmaps > and closes > the file. I am using a custom written data structure as well > in the > program. There is no leak associated with the data structure. > But some > ware a big leak is present. (I dont know where) I assume it > could be > with mmap and munmap... Because as I open more and more files, > the leak > gradually increases to megabytes! but for each mam,p the > munmap is > called correspondingly. And the range which I give to unmap is > correct. > > Where could be the source of problem? Even after the program > exit the > memory consumption remains same (not reducted to the program > startup > state). I see this with the aid of system monitoring tool.. > > please help me... > > Thanks and Regards, > Lloyd > > > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and > take > control of your XML. No limits. Just data. Click to get it > now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: > http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > -- > <Morpheus> linux, c'est une question de VI ou de MORE ______________________________________ Scanned and protected by Email scanner |
|
From: Per W. <pw...@ia...> - 2007-05-25 08:52:04
|
How are you deciding that the application is leaking memory? Are you just looking at amount of free memory in Linux? Note that Linux will try to use as much of it's memory as possible for file caching, i.e. if you open and read a file and then close the application, the amount of free memory will shrink, since the OS has cached the contents of the file. The only "loss" of memory I normally have seen in Linux is when applications allocates named shared memory, and forgets to release it. The kernel will keep the shared memory blocks, allowing other applications to specify the same name to get access to the memory block. /pwm On Fri, 25 May 2007, Lloyd wrote: > Thank you Jonathan. I tried using valgrind, but my program uses > wxWidgets (a GUI library). The out put of valgrind is unreadable and not > understandable for me :( > > It shows lots of lines as output > > When I executed my program more and more, at the first stages (first few > 100 files) of file mapping no leak is shown, but when I go further, for > each 10 or 15 files 1MB to 3MB of leak is shown! I am not understanding > whats happening. Is there any chance of going something in the OS? > > Thank you, > Lloyd > > > On Fri, 2007-05-25 at 08:28 +0200, Jonathan Winterflood wrote: > > Hi, > > > > Maybe you should use valgrind to test your program for leaks > > (compiling with debugging symbols should help you get a digestable > > log) > > > > Jonathan > > > > On 5/24/07, Lloyd <ll...@cd...> wrote: > > Hi, > > I have written a program in Linux. > > It opens a file and maps it to memory using mmap and unmaps > > and closes > > the file. I am using a custom written data structure as well > > in the > > program. There is no leak associated with the data structure. > > But some > > ware a big leak is present. (I dont know where) I assume it > > could be > > with mmap and munmap... Because as I open more and more files, > > the leak > > gradually increases to megabytes! but for each mam,p the > > munmap is > > called correspondingly. And the range which I give to unmap is > > correct. > > > > Where could be the source of problem? Even after the program > > exit the > > memory consumption remains same (not reducted to the program > > startup > > state). I see this with the aid of system monitoring tool.. > > > > please help me... > > > > Thanks and Regards, > > Lloyd > > > > > > > > > > ______________________________________ > > Scanned and protected by Email scanner > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and > > take > > control of your XML. No limits. Just data. Click to get it > > now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: > > http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > -- > > <Morpheus> linux, c'est une question de VI ou de MORE > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: hhh h. <the...@ho...> - 2007-05-27 10:56:16
|
Estimeed dev...@li... : Hi people... I was hoping that you could point me some guidance. I want to write a little app that captures images and video from my web cam, but i can't seem to find any useful sources, as they are all strangely written, like private use code. So, if u please could help me out, I would be very much appreciated _________________________________________________________________ Fazer um telefonema para o PC de um amigo não custa nada. É grátis! http://get.live.com/pt-pt/messenger/overview |
|
From: Rory W. <ror...@ea...> - 2007-05-27 17:09:04
|
I have done this using the windows API but it was a long time ago and that code is long gone. Try doing a search for 'Video Capture Functions win32' in google and you should find plenty of useful info. You could also try using directx which also has certain functions to capturing video. Best of luck with it. Rory. hhh hhh wrote: > Estimeed dev...@li... : > > Hi people... I was hoping that you could point me some guidance. I want to > write a little app that captures images and video from my web cam, but i > can't seem to find any useful sources, as they are all strangely written, > like private use code. > So, if u please could help me out, I would be very much appreciated > > _________________________________________________________________ > Fazer um telefonema para o PC de um amigo não custa nada. É grátis! > http://get.live.com/pt-pt/messenger/overview > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Jonathan W. <jon...@gm...> - 2007-05-27 17:22:18
|
You could try looking into the Virtualdub capture mode code: it supports windows' video capture interface. http://www.virtualdub.org Jonathan On 5/27/07, Rory Walsh <ror...@ea...> wrote: > > I have done this using the windows API but it was a long time ago and > that code is long gone. Try doing a search for 'Video Capture Functions > win32' in google and you should find plenty of useful info. You could > also try using directx which also has certain functions to capturing > video. Best of luck with it. > > Rory. > > hhh hhh wrote: > > Estimeed dev...@li... : > > > > Hi people... I was hoping that you could point me some guidance. I > want to > > write a little app that captures images and video from my web cam, but = i > > can't seem to find any useful sources, as they are all strangely > written, > > like private use code. > > So, if u please could help me out, I would be very much appreciated > > > > _________________________________________________________________ > > Fazer um telefonema para o PC de um amigo n=E3o custa nada. =C9 gr=E1ti= s! > > http://get.live.com/pt-pt/messenger/overview > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > --=20 <Morpheus> linux, c'est une question de VI ou de MORE |