From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) by sourceware.org (Postfix) with ESMTPS id 4D7F63857820 for ; Fri, 25 Jun 2021 00:08:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D7F63857820 Date: Fri, 25 Jun 2021 00:08:46 +0000 To: The Cygwin Mailing List From: Viet-Duc Le Cc: Jon Turney , Takashi Yano Reply-To: Viet-Duc Le Subject: Re: xwin-xdg-menu high cpu usage with rxvt-unicode Message-ID: <5ODXHOy6V1_1syKCgn8erXeXr5goM3hltEnxw1q3hBS4yD_jPTR1N0qrVlE1bGQ39G0zOeDskizMCPmNDfYUrnqerfTqYXo6kpOBbQlefRU=@protonmail.com> In-Reply-To: <608c8616-52a3-bbfb-f8f0-983a6c4453b1@dronecode.org.uk> References: <20210623120858.83e471aa7ddbc20cd41efb2c@nifty.ne.jp> <608c8616-52a3-bbfb-f8f0-983a6c4453b1@dronecode.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 00:08:55 -0000 I've tested the patched version. At the moment, xwin-xdg-menu no longer incurs high resources with multiple = instances of rxvt-unicode. @Takashi: Thanks for investigating the issues and providing a patch. @Jon: Thanks for providing the test package. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Thursday, June 24th, 2021 at 1:41 AM, Jon Turney wrote: > On 23/06/2021 04:08, Takashi Yano wrote: > > > On Mon, 21 Jun 2021 05:49:28 +0000 > > > > Viet-Duc Le wrote: > > > > > Hi, > > > > > > I've encountered a peculiar issue with rxvt-unicode launched from xwi= n-xdg-menu (20170321-1) > > > > > > The image below corresponds to two rxvt-unicode instances, each occup= ies 30% of system resouce. > > > > > > https://imgur.com/a/FTFwIrZ > > > > > > I'm using the the latest version of cygwin. 'cygcheck.out' is attache= d per guideline. > > > > > > Steps to reproduce: > > > > > > - Start XWin Server from Start menu > > > - X applications menu -> System Tools -> rxvt-unicode > > > - Kill rxvt-unicode to free the resource again > > > > > > Other observations: > > > > > > - XTerm does not incur high resources. > > > - Manually launching rxvt-unicode from XTerm does not incur high re= sources. > > > > > > I think this is not an issue with rxvt but with xwin-xdg-menu. > > > > > > On laptop, it is very noticeable when the fan kicks in. > > > > > > Insights and suggestions are much appreciated. > > > > > > Thanks. > > > > > > Viet-Duc > > > > I looked into this problem and found the cause. > > > > urxvt seems to close stdout while xwin-xdg-menu use select() > > > > to read stdout of the launched apps. Since stdout is closed, > > > > select() returns repeatedly without any output. This causes > > > > high cpu load. > > > > I also confirmed that the following patch for xwin-xdg-menu > > > > resolves the issue. > > [...] > > > Jon, could you please have a look? > > Thanks very much for looking into this, and the patch. > > That looks right. > > I applied the patch, and built and uploaded a xwin-xdg-menu-20210623-1 > > test package. > > Perhaps you could try that, and see if it improves things for you? > > (Similar code is used in XWin, so I also need to make a similar change > > there) > > -------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------- > > Problem reports: https://cygwin.com/problems.html > > FAQ: https://cygwin.com/faq/ > > Documentation: https://cygwin.com/docs.html > > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple