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?


Kensuke --- This may be related to why you do not see the XWin.exe memory usage decrease even with your new patch.

Chris,

Interesting. I guess you learn something new everyday.

Hmm... it seems like the memory should be returned to the Windows heap at some point (yeah yeah, patches accepted) if only for the reason that a user with 256 MB of RAM and a 512 MB swap file maximum may at one point have 512 MB allocated in Cygwin... when most of this 512 MB was freed it would end up being swapped to disk (even though it contained no data) and it would sit there plugging the virtual memory file until the user unloaded all applications that use cygwin1.dll. I think this design may have been okay before Cygwin/XFree86 became popular, but now people are using applications on Cygwin that do indeed have the potential to allocate several hundred megabytes of memory, so perhaps it is time for a redesign.

With that being said, are there any volunteers out there willing to spend a few months looking into this and developing a robust solution? :)

Harold

Christopher Faylor wrote:

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]