Hi, First make sure that memory allocated by __get_free_pages is reserved using SetPageReserved or not. If SetPageReserved function is used after __get_free_pages, than you need to call ClearPageReserved before free_pages.
Hope this will solve your problem. Regards, Pratik Patel ---------------------------------------------------------------------- Message: 1 Date: Fri, 4 Jan 2008 12:28:18 +0530 From: "Srinivasan S" <[EMAIL PROTECTED]> Subject: Memory leak issue get_free_pages and free_pages To: <[email protected]> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Hi, I downloaded GIt kernel v2.6.23-davinci1 and brought it up on TIEVM6446. When I run my video application multiple times I observe that the free memory available in the system decreasing, suggesting a possible memory leak in the Video capture driver. I did the following experiments: 1. Experiment 1 a. Tested with the simple video capture test application that does the following i. Open video capture device /dev/video0 ii. Call the VIDIOC_REQBUFS ioctl to get 2 capture buffers iii. Close video capture device iv. Repeat the above three steps 1000 times b. After running the above test application I saw that the systems free memory was reduced (I used top to monitor the free memory while the application was running) 2. Experiment 2 a. VIDIOC_REQB IOCTL code uses the __get_free_pages and the free_reserved_pages kernel calls, suspecting them I tested with simple test application that does the following i. Open a character device, in the open call we allocate 8K of memory using __get_free_pages call ii. Close that charater device, in the close call we freed the 8K of memory using free_ reserved_pages call. iii. Repeated the above two steps 1000 times b. Here too we observed leak in the memory. In my view it appears that the kernel calls get_free_pages and free_ reserved_pages are leaking small amount of memory each time. It would be great and very helpful if any one could share similar observations, let me know if there is any fix for this issue already available or if am I missing anything in these experiments. Happy New year and Best Regards, Srinivasan S ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [EMAIL PROTECTED] ********************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: http://linux.omap.com/pipermail/davinci-linux-open-source/attachments/200801 04/738fdf46/attachment-0001.htm ------------------------------ _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source End of Davinci-linux-open-source Digest, Vol 25, Issue 3 ******************************************************** - This message has been scanned for viruses, spam and dangerous content and is believed to be clean. -- eInfochips Business Disclaimer: This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose,distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated.Nothing contained in this message shall be construed as an offer or acceptance of any offer by eInfochips Limited and/or eInfochips Inc(“eInfochips”) unless sent with that express intent and with due authority of eInfochips.EInfochips has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
