Skip to content

llvm-strings excessive memory use when used in a pipe #138855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emaste opened this issue May 7, 2025 · 1 comment
Open

llvm-strings excessive memory use when used in a pipe #138855

emaste opened this issue May 7, 2025 · 1 comment

Comments

@emaste
Copy link
Member

emaste commented May 7, 2025

As reported in FreeBSD bugzilla, after FreeBSD switched from ELF Tool Chain's binary utilities to using LLVM's by default:

It seems the LLVM’s version isn’t able to mmap while
used in a pipe, so it copy ALL the file into memory.

Example:
$ dd if=/dev/urandom of=/tmp/test.file bs=1M count=1024
$ cat /tmp/test.file | strings > /dev/null &

Now with elftoolchain’s strings:
$ ps -o pid,command,vsz,rss | grep strings
53243 strings          12992  2556

And with LLVM’strings:
$ ps -o pid,command,vsz,rss | grep strings
41791 strings          5027836 3413864

And with our use-case, we are using strings on GB files
(like core dump), and it is now consumming all our memory.
@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/issue-subscribers-tools-llvm-strings

Author: Ed Maste (emaste)

As [reported in FreeBSD bugzilla](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286605), after FreeBSD switched from ELF Tool Chain's binary utilities to using LLVM's by default:
It seems the LLVM’s version isn’t able to mmap while
used in a pipe, so it copy ALL the file into memory.

Example:
$ dd if=/dev/urandom of=/tmp/test.file bs=1M count=1024
$ cat /tmp/test.file | strings > /dev/null &

Now with elftoolchain’s strings:
$ ps -o pid,command,vsz,rss | grep strings
53243 strings          12992  2556

And with LLVM’strings:
$ ps -o pid,command,vsz,rss | grep strings
41791 strings          5027836 3413864

And with our use-case, we are using strings on GB files
(like core dump), and it is now consumming all our memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants