Doing global search and replace on the newline character in vim can consume much more memory than anticipated.
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.