Tar extraction consumes several GB of memory

Solution Verified - Updated -

Issue

  • When extracting a Tar archive containing many symbolic links, Tar consumes several Gigabytes of memory

    # egrep "(VmRSS|VmData)" $(pidof tar)
    VmRSS:   2456600 kB
    VmData:  2456048 kB
    
  • Eventually, when not enough memory can be committed, Tar program gets killed by OOM killer, as seen in the system log excerpt below

    <DATE> <HOSTNAME> kernel: Out of memory: Kill process <PID> (tar) score <SCORE> or sacrifice child                                                                                                      
    

Environment

  • Red Hat Enterprise Linux
    • tar

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content