Category Archives: applications

Are “find in project” searches in TextMate slow and eating up all of your CPU and RAM?

I was doing a casual project-wide search for some text yesterday when suddenly my computer ground to a halt. I opened Activity Monitor and saw that TextMate was taking up 2.42 GB of RAM. Yes, gigabytes. Not only that, the Find In Project searches were extremely slow.

I started poking around and found another blog entry dated April 27, 2006, and that gave me the answer. It turns out that TextMate will search all files it thinks are text, even if the files are binary files. And if you have a large project like mine then you’ll end up consuming all of your computer’s memory while it searches all of the graphics files and audio files.

textmate_treat_files_as_binary_1.png

TextMate’s way of ignoring binary files is for you to explicitly tell it that certain extensions are NOT text. How do you know what TextMate is thinking? Right-click/ctrl-click on a file in your project drawer and you should get the “Treat Files with ‘.png’ Extension as Binary” message when TextMate is searching those files. Try all of your .pdf, .png, .gif, .jpg, .mp3, .doc files.

textmate_treat_files_as_binary_2.png