From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14850: 24.3; GDI Handles leak(Windows) Date: Sat, 13 Jul 2013 15:55:35 +0300 Message-ID: <83r4f24o1k.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1373720227 4786 80.91.229.3 (13 Jul 2013 12:57:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Jul 2013 12:57:07 +0000 (UTC) Cc: 14850@debbugs.gnu.org To: Akihiro KAYAMA Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 13 14:57:09 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UxzNt-0005y8-0x for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2013 14:57:09 +0200 Original-Received: from localhost ([::1]:51913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxzNs-00084D-OO for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2013 08:57:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxzNp-000848-LN for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2013 08:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxzNo-0004LU-Mu for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2013 08:57:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxzNo-0004LQ-JC for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2013 08:57:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UxzNn-0002rE-QL for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2013 08:57:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2013 12:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14850 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14850-submit@debbugs.gnu.org id=B14850.137372017510844 (code B ref 14850); Sat, 13 Jul 2013 12:57:02 +0000 Original-Received: (at 14850) by debbugs.gnu.org; 13 Jul 2013 12:56:15 +0000 Original-Received: from localhost ([127.0.0.1]:52231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxzMy-0002oo-St for submit@debbugs.gnu.org; Sat, 13 Jul 2013 08:56:14 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:45211) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxzMl-0002o4-Nk for 14850@debbugs.gnu.org; Sat, 13 Jul 2013 08:56:01 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MPV00B00KTFR000@a-mtaout23.012.net.il> for 14850@debbugs.gnu.org; Sat, 13 Jul 2013 15:55:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MPV00BG9L8PR720@a-mtaout23.012.net.il>; Sat, 13 Jul 2013 15:55:37 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76324 Archived-At: > Date: Fri, 12 Jul 2013 18:49:48 +0900 > From: Akihiro KAYAMA > > When using multiple emacs frames and shell buffer in Windows, > Emacs process's GDI Handles increase constantly. > > How to reproduce: > > - emacs.exe -Q > - M-x make-frame-command > - M-x shell > - ping 127.0.0.1 -t (continuous shell output) > - M-x find-file (open some mini buffer) > - inspect Emacs process's GDI Handles by Process Explorer( > www.sysinternals.com) > > As the increasing ratio is in proportion to number of frames, with a > dozen frames Emacs process can easily reach Windows OS limit(=10000 handles) > in a few minutes. I don't think the number of frames is such an important factor here. E.g., try evaluating this in "emacs -Q": (dotimes (i 30) (make-frame)) and compare the number of GDI objects before and after. On my machine, the difference is much smaller than 30, it's more like 10. Anyway, I looked through the sources for the Windows API calls that are documented to produce GDI objects. All of them seem to have the appropriate calls to DeleteObject or similar APIs that release these resources. So it doesn't seem like we are too sloppy about this, at least not enough for me to find that. Not that I know too much about this issue. Patches are welcome to make our usage of GDI objects smaller. Pointers to places where we fail to release GDI objects are also welcome.