Doing global search and replace on the newline character in vim can consume much more memory than anticipated.

Solution In Progress - Updated -

Issue

Doing global search and replace of the newline character (\n) in vim can consume much more memory in the Operating System than anticipated, if enough entries are replaced and the joined line is sufficiently long. This could lead to system hangs or oom-killer invocations.

Environment

Red Hat Enterprise Linux (RHEL) 5
Red Hat Enterprise Linux (RHEL) 6

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