From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30161 invoked by alias); 22 Jul 2010 20:34:05 -0000 Received: (qmail 30052 invoked by uid 22791); 22 Jul 2010 20:34:04 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from smtpout.karoo.kcom.com (HELO smtpout.karoo.kcom.com) (212.50.160.34) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Jul 2010 20:33:56 +0000 Received: from 213-152-38-55.dsl.eclipse.net.uk (HELO [192.168.0.16]) ([213.152.38.55]) by smtpout.karoo.kcom.com with ESMTP; 22 Jul 2010 21:33:53 +0100 Message-ID: <4C48AB39.7050703@dronecode.org.uk> Date: Thu, 22 Jul 2010 20:34:00 -0000 From: Jon TURNEY Reply-To: cygwin-xfree@cygwin.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com CC: akhailtash@yahoo.com Subject: Re: USER/GDI Objects leak with (XWin.exe) Cygwin/X X Server Verion 1.7.6, Build Date 2010-03-18 References: <745077.37241.qm@web88004.mail.re2.yahoo.com> <4BB0DB76.20708@dronecode.org.uk> <599525.40364.qm@web88006.mail.re2.yahoo.com> <4BBA5671.7060309@dronecode.org.uk> <730771.75866.qm@web88008.mail.re2.yahoo.com> <4BCB61A2.3070503@dronecode.org.uk> <333099.79245.qm@web88002.mail.re2.yahoo.com> In-Reply-To: <333099.79245.qm@web88002.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com X-SW-Source: 2010-07/txt/msg00082.txt.bz2 On 19/04/2010 18:33, Amal Khailtash wrote: > Thanks for looking into this. Yes, it seems this problem shows up for some applications. gnome-terminal > seems to behave better. But konsole and my specific TCL-based application (modelsim) seem to suffer > from this. > > The problem is even if I quit the troublesome application, resources are not released and that tells me > the leak is somewhere in the core X server and not the application, but somehow only shows up for those. This is expected, because as far as Windows is concerned, all the X windows and the resources they use are owned by the X server. > Some of the applications that I found that show this leak are: > > * modelsim > * konsole > * kfontview > * kate > > It seems KDE-based apps are the worst. The problem is not as severe in gnome-based applications. > But I can see that, even in those, not all resources are released either! I have (finally) tracked down what I think is causing this leak. It seems we are leaking the Windows icons we create when the X window has an icon hint attached. It also seems that menu windows for the problematic apps like konsole have such an icon hint, so we leak at a vast rate whilst working with them. (There's not much point in making the Windows icon for these transient windows, as it can't be seen, so perhaps there's another change needed to avoid the overhead of generating the Windows icon in these cases) I've uploaded a build with this fix at [1], patch to follow. Perhaps you could try it out and see if it works for you? [1] ftp://cygwin.com/pub/cygwinx/XWin.20100722-git-3e2987e614139d51.exe.bz2 > Another not is that even Xming suffers from this same problem. I assume most of the source code is > shared between XWin and Xming. It depends which version of Xming you are using, something you should have mentioned. If you are using the current version of Xming, that is the case. If you are using the free version of Xming, that's about 3 years old. There have been a few changes in the source since then :-) > ----- Original Message ---- > Subject: Re: USER/GDI Objects leak with (XWin.exe) Cygwin/X X Server Verion 1.7.6, Build Date 2010-03-18 > > On 06/04/2010 20:05, Amal Khailtash wrote: >> Click on Session menu and while the menu is open, move to Edit, then View, Bookmarks, >> Settings and Help and click outside to withdraw menu: >> >> Image Name User Objects GDI Objects >> XWin.exe 39 79 >> >> Click on any menu item and while the menu is open and move cursor to other menu items >> a number of (20) times: >> >> Image Name User Objects GDI Objects >> XWin.exe 241 483 >> >> Keep doing this and you will see the allocated objects keeps increasing and increasing and >> they are never released even if I close my Konsole window! > > Thanks for the clear reproduction steps. With these, I can reproduce this problem. > > According to the GdiUsage tool this seems to be a GDI bitmap handle being leaked. Unfortunately GdiUsage seems to have rusted a bit and doesn't produce useful backtraces (and may well not be able to backtrace a cygwin executable, anyhow) so locating exactly where the leak is coming from is going to be a bit tricky... -- Jon TURNEY Volunteer Cygwin/X X Server maintainer -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/