beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

Don't let ack take up all memory #514

Closed hoelzro closed 5 years ago

hoelzro commented 9 years ago

In some (fairly) recent changes to ack since 2.14, I created an optimization by reading in a file in its entirely and calling the regex engine on that giant blob instead of applying the regex line by line. This is great, as it results in a giant speed boost. What's not so great is when ack mistakenly starts searching a huge file that consumes all memory on the machine. So there are a few ways we can get around this:

hoelzro commented 9 years ago

For the mmap route, Sys::Mmap and File::Map seem to be popular choices.

petdance commented 5 years ago

There will probably be no more releases of ack 2. If this is still a relevant idea, please submit it to the ack3 repo at https://github.com/beyondgrep/ack3.