|
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 > |