From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id C4A99385781C for ; Sun, 21 Feb 2021 15:18:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C4A99385781C Received: by mail-qk1-x730.google.com with SMTP id b14so10355139qkk.0 for ; Sun, 21 Feb 2021 07:18:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :thread-index:content-language; bh=jfjvbkQ+J00wSRTCvAJXMzqH4zuTTSEFNerstwRoM+Q=; b=TsJOPKsQmfBPYS+WQdM2rtRF7NU8FXfdvlG36CLjYZhbTaKJkTr13pIKV3Fdv15xrE h4I/ICRq8u4+olNMBmUoRxDLt7c7PlFftQsemcxRhoxamRMn7BIyTKsmnJlLRQR0G0q2 7yJtBWsqFrgfaPtuD1rQzCRINhktGXjSWhd2HwozsCIVZbG0b20Q1htzmTmzL42AuR7D lAVKxAfWFbvP/otd/yo5Img/nNwdBm0o1+q61AxaX7HJ3/7sWZmpa/jkesSTA/bsdtXC saz9lCMvcu/ilwtZM78XXEBM8jeJFLLt6uD0K3czNs4cTML5PhTERz5JaD2F+8WgzpYH Infw== X-Gm-Message-State: AOAM531hm49g7QJq5YpE9dHM8uVMI8vfUR3ATExu81fIBRl0ilJSTemb 2q0xmA7Z/yIvN7UT4QjaNDO9VRueSmgHiw== X-Google-Smtp-Source: ABdhPJzVDdZLbXZgxEbh+FDw45QZT8KV5cx/qM7AF1jZxowDJIkyPPdL0Xphn1UoxJS4XpJ7LXnkGA== X-Received: by 2002:a37:9a41:: with SMTP id c62mr18223656qke.19.1613920707031; Sun, 21 Feb 2021 07:18:27 -0800 (PST) Received: from NEALPC (76-230-231-78.lightspeed.tukrga.sbcglobal.net. [76.230.231.78]) by smtp.gmail.com with ESMTPSA id o3sm10084594qke.132.2021.02.21.07.18.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Feb 2021 07:18:26 -0800 (PST) From: To: Subject: CRITICAL ls MEMORY LEAK Date: Sun, 21 Feb 2021 10:18:25 -0500 Message-ID: <003401d70864$cd3b3400$67b19c00$@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdcIZAuyC4/0RFd+SKWcW7oM7hlMSA== Content-Language: en-us X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_20, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sun, 21 Feb 2021 15:18:29 -0000 I deal with a lot of very large files on a regular basis. I've noticed that when I delve into these directories using in mintty and issue the command ls -l (or ls -color=auto), a very large junk of memory is consumed. The memory leak seems to be proportionate to the number and size of files within the containing folder. To reproduce: generate or use a folder containing 50 (or more) 2G+ files. // In this demonstration, I a ran the command on a directory containing 143 files ranging in size from 2GB to 5GB. $> free total used free shared buff/cache available Mem: 50276004 16465148 33810856 0 0 33810856 Swap: 12058624 186468 11872156 $> ls -l -color=auto . (contents displayed after some delay) $> free total used free shared buff/cache available Mem: 50276004 19844660 30431344 0 0 30431344 Swap: 12058624 186460 11872164 // After 10 consecutive executions of the 'ls -al --color=auto' command in this directory, ls has consumed 86% of my system's real memory. $> free total used free shared buff/cache available Mem: 50276004 43587560 6688444 0 0 6688444 Swap: 12058624 301068 11757556 // If I continue (usually unknowingly) my system will completely be depleted of resources to the point my mouse will barely respond to movement. --