bugfindutils - Bugs: bug #37356, excessive memory usage when using...


bug #37356: excessive memory usage when using -printf and %A %C or %T

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Sat 15 Sep 2012 01:43:45 PM UTC  
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Nemo Maelstrom ThorxOpen/Closed: Closed
Release: 4.4.2Fixed Release: 4.5.11

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 17 Nov 2012 01:41:20 PM UTC, comment #2:

I've applied and pushed Jim's fix. Thanks, Jim.

James Youngman <jay>
Project AdministratorIn charge of this item.
Tue 18 Sep 2012 10:30:06 AM UTC, comment #1:

Note that the V2 patch should be applied after the three patches I posted here: http://thread.gmane.org/gmane.comp.gnu.findutils.bugs/5216

However, they are really independent, and that order is imposed solely due to the fact that ChangeLog is version-controlled.

Jim Meyering <meyering>
Sat 15 Sep 2012 01:43:45 PM UTC, original submission:


Nemo Maelstrom Thorx reported the following issue in the Debian bts <http://bugs.debian.org/687358>. Afaict it applies to both 4.4.2 and 4.5.10. As it also is found in the oldfind variant this should not be a duplicate of <http://savannah.gnu.org/bugs/?34079>

cu Andreas

Find appears to consume and not release large amounts of memory when asked to print time directives with custom formatting. ie, %Ak, %Ck and %Tk.

The rate of memory consumption appears to correlate with the number of these directives used

Observable by running, for eg:
# find / -printf "[%y %11s %TY.%Tm.%Td %TH:%TM]\t%p\n"

...and simultaneously 'top' or other memory monitor. Resident size grows without check.

With enough files being found, this can grow to trigger an OOM.

I've marked this as upstream, as I've since observed the same behaviour on find 4.4.2 in CentOS (as well as in debian derivatives mint and ubuntu)

Experimental 4.5 also appears to have the same issue.

However 4.2 on an older non-debian system did not have this issue.


Andreas Metzler <ametzler>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #26578:  find-leaks-v2.patch added by meyering (3KiB - text/x-patch - I see findutils still VCs ChangeLog, so here's a revised patch.)
file #26574:  find-leaks.patch added by meyering (2KiB - text/x-patch - Thanks for the report. There were two leaks. I've attached a patch that fixes them.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by meyering (Updated the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 02 Feb 2013 02:55:46 PM UTCjayFixed ReleaseNone=>4.5.11
    Sat 17 Nov 2012 01:41:20 PM UTCjayStatusNone=>Fixed
      Assigned toNone=>jay
    Tue 18 Sep 2012 10:26:20 AM UTCmeyeringAttached File-=>Added find-leaks-v2.patch, #26578
    Tue 18 Sep 2012 10:04:09 AM UTCmeyeringAttached File-=>Added find-leaks.patch, #26574
    Sat 15 Sep 2012 01:45:15 PM UTCametzlerCarbon-CopyRemoved 20807=>-

    Back to the top

    Powered by Savane 3.1-cleanup1