This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xfree leaking memory?


 The non-return of the free memory to Windows could explain things if XWin
stopped growing after a while. Yet it easily goes from 12 to 20 Mb (I have
seen even 150 Mb) and generally shows no signs of slowing down. The memory
usage in the 150 Mb case was real since I heard swapping and the total
consumed memory exceeded RAM.
 Is it possible that free() calls with a small memory leak leave the heap
sufficiently fragmented such that new requests have to be fulfilled by
going to Windows and getting larger chunks from there?
 I will attach the Windows performance monitor to XWin and collect some
statistics on what is happening with the memory.

 Konstantin

On Tue, 5 Nov 2002, it was written:

> On Tue, Nov 05, 2002 at 05:00:55PM -0500, Harold L Hunt II wrote:
> >It was mentioned that the memory size increased when a new X window
> >(such as an xterm) is opened, but that it does not decrease when that
> >window is destroyed.  This indicates one of a few things to me:
> >
> >1) We are not freeing our window privates (directly or indirectly).
> >This seems plausible, but I don't think our window privates are even 1
> >kilobyte.
>
> I thought I should point out that Cygwin doesn't currently return deallocated
> memory to the windows pool.  So, the heap only gets larger.
>
> It does reuse previously allocated memory, of course.  So, a
> malloc/free/malloc will not necessarily consume any more system memory.
>
> So, if the memory size grows every time an xterm is opened but then
> does not get any larger if subsequent xterms are closed and opened,
> then that is probably expected behavior.
>
> cgf
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]