[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leaks when writing to a file



Isn't it just that the file written is cached?
Examine /proc/meminfo closer or post it here
(version before and after the program is executed)
Also, what filename are you using?
(are you writing to /tmp/, /etc/  or /mnt/flash/ ?)

/Johan


----- Original Message -----
From: Mark Schapira <mschapira@xxxxxxx.com>
To: <dev-etrax@xxxxxxx.com>
Sent: Monday, May 14, 2001 8:24 PM
Subject: memory leaks when writing to a file


> When I write to a file from a c++ class , I find that memory leaks occur.
> This is especially true if I make a relatively large number of writes.
> When I execute:
> cat /proc/meminfo
> run the program in question.
> cat /proc/meminfo
> The second /cat/procmeminfo shows that the amount of memory available is
> considerably less.
> I have run some tests and I have determined that writing to the file
causes
> the memory leak.
>
> I am attaching a .tgz file which will illustrate this problem.
>
> Please let me know why the memory leak occurs.
>
> Thanks in advance.
>
> Mark Schapira
>
>
> (See attached file: writetest.tgz)