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 Sep 15 13:43:45 2012  
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 MarkupRich Markup):

You are not logged in

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


Sat Nov 17 13:41:20 2012, comment #2:

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

James Youngman <jay>
Project AdministratorIn charge of this item.
Tue Sep 18 10:30:06 2012, 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 Sep 15 13:43:45 2012, 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 (3kB - text/x-patch - I see findutils still VCs ChangeLog, so here's a revised patch.)
file #26574:  find-leaks.patch added by meyering (2kB - 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
  • -unavailable- added by jay (Posted a comment)
  • -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 Feb 2 14:55:46 2013jayFixed ReleaseNone=>4.5.11
    Sat Nov 17 13:41:20 2012jayStatusNone=>Fixed
      Assigned toNone=>jay
    Tue Sep 18 10:26:20 2012meyeringAttached File-=>Added find-leaks-v2.patch, #26578
    Tue Sep 18 10:04:09 2012meyeringAttached File-=>Added find-leaks.patch, #26574
    Sat Sep 15 13:45:15 2012ametzlerCarbon-CopyRemoved 20807=>-

    Back to the top

    Powered by Savane 3.1-cleanup1