From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.gdatech.co.in (mail.gdatech.co.in [220.225.128.84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.gdatech.co.in", Issuer "mail.gdatech.co.in" (not verified)) by ozlabs.org (Postfix) with ESMTP id 81DB667B28 for ; Mon, 2 May 2005 16:56:30 +1000 (EST) Content-Type: multipart/mixed; boundary="=-bd-boundary-Ev8yDkhKB5bIMy7K" Mime-Version: 1.0 Message-ID: <02cb01c54ee3$87e93ec0$4000a8c0@DeepakS> From: "s.deepak" To: Date: Mon, 2 May 2005 12:22:39 +0530 Subject: Memory Usage Growth in File access List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multipart message in MIME format, containing the original message body and a footer added by BitDefender --=-bd-boundary-Ev8yDkhKB5bIMy7K Content-Type: multipart/alternative; boundary="----=_NextPart_000_02C8_01C54F11.A1790B30" This is a multi-part message in MIME format. ------=_NextPart_000_02C8_01C54F11.A1790B30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All, I am facing an issue in file operation, when we read/write continuously = to a large file in our ppc 405 based device , memory usage shown in = /proc/meminfo increases by the number of bytes accessed.And after = closing the application also the memory used is not released and it = goes to cached memory . We are using 2.4.20 kernel in our device.We are not sure whether the = /proc/meminfo shows the erroneous output or the file read/write routines = got any problem. Can anyone suggest me some idea how to trace out the problem. I have given the sample code below. The memory consumption grows and it takes about 10 MB memory space = [10000 * 1024] when i run the below given code. When i look into /proc/meminfo the free memory is reduced by 10 MB and = Cache Memory & Used memory is increased by 10 mb after running this = application. When i run the below given code first time the memory grows,when i run = succesively it doesn't grow again , may be using the already taken = memory. int main() { FILE *fp; unsigned long int i; unsigned char data[1024]; fp=3Dfopen("test.txt","r"); for(i=3D0;i<10000;i++) { fread(data,1024,1,fp); } fclose(fp); } With Thanks & Regards, Deepak S ------=_NextPart_000_02C8_01C54F11.A1790B30 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi All,
 
I am  facing an issue in file=20 operation, when we read/write = continuously=20 to  a large file in our  ppc 405 based device , memory usage = shown in=20 /proc/meminfo   increases by the number of bytes = accessed.And after closing the application also the memory = used is not=20 released and  it goes to cached memory .
We are using 2.4.20 kernel in our = device.We are not=20 sure whether the /proc/meminfo shows the erroneous output or the file = read/write=20 routines got any problem.
Can anyone suggest me some idea how to trace out the problem.
 
I have given the sample code  below.
The memory consumption grows and it takes about 10 MB memory space = [10000 *=20 1024] when i run the below given code.
When i look into /proc/meminfo the free memory is reduced by 10 MB = and=20 Cache Memory & Used memory is increased by 10 mb after running this=20 application.
When i run the below given code first time the memory = grows,when  i=20 run succesively it doesn't grow again , may be using the already taken=20 memory.
 
 
 
int main()
{
 
FILE *fp;
unsigned long int i;
unsigned char data[1024];
 
fp=3Dfopen("test.txt","r");
for(i=3D0;i<10000;i++)
{
 
     =20 fread(data,1024,1,fp);
}
fclose(fp);
}
 
 
With Thanks & Regards,
Deepak S
 
------=_NextPart_000_02C8_01C54F11.A1790B30-- --=-bd-boundary-Ev8yDkhKB5bIMy7K Content-Type: text/plain; name="BitDefender.txt" Content-Disposition: inline; filename="BitDefender.txt" -- This message contains information from GDA Technologies LTD and affiliates, and is intended for the sole use of the individual and entity to whom it is addressed. It may contain information, including any attachments, that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all electronic and hard copies of the communication, including attachments. This message was scanned for spam and viruses by BitDefender. --=-bd-boundary-Ev8yDkhKB5bIMy7K--