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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.