Quicktime freezes every single time I'm finishing a recording I used to be able to take screencasts with QuickTime just fine for over a year now. But suddenly, every time I try and go above 3 or 4 minutes, by the time I finish, QuickTime just freezes. I can only kill it. When opening it the next time, it presents to me only part of the recording.

What could possibly cause this?

I got Yosemite v10.10.5 and QuickTime v10.4 (build 833.7)
@fbara was right: It is the ram, but it is not obvious. Basically, what I am recording now requires a whole variety of software to be open at the same time, quickly reaching the limits of my Air's 4GB of RAM.
Once you use more than 70-80% of your ram, stuff starts getting compressed and swapped, and apparently, Quicktime cannot quite work with that.

Solution: Get more RAM and send complaint letters to Quicktime for not informing you why your recordings fail.