Delta Engine Blog

AI, Robotics, multiplatform game development and Strict programming language

Disable Hybernation file (hiberfil.sys) if you have a small hard disk

I recently build a new work pc and used a small SSD hard drive (64 GB) for it. I was using Windows 7 last week, but since so many programs (daemon tools), drivers (printer) and especially games (everything new?) did not work I just switched back to Windows Vista x64 SP1 yesterday.

One of the problems with this small SSD drive is that it gets full really quick. Especially with Vista, which takes almost 20 GB right out of the box. Then you have Visual Studio, all the tools and you are left with 20-30 GB. Our current project is huge and can take up to 37 GB (thanks to subversions great feature to double any project size, arg) and I still want it on my SSD drive because it is so much faster to work with many little source code files (Visual Studio is just not the same anymore, everything is soooooo much faster ^^).

Well, the point of the story is, with a really small drive it is kinda important to delete everything that I do not need. So I decreased the page file to 256 MB (from 6GB) and allowed the system to use the secondary drive to use a page file (there I have 500 GB free space). I also deleted everything I could from windows, program files or users (don't do this at home, I backed up everything on my Server where I have like 12 TB of space, hehe). A few more GB free space, yay. I also messed with Subversion and killed all the .svn directories for artist stuff I do not update very often, so I still got around 15 GB free right now :)

But I still wanted to delete the hiberfil.sys file, which takes up several GB too, but unlike Windows XP there is no option to do that. So you have to type in the following command (or create a simple .cmd file for that):

powercfg.exe -h off

And to enable it again type:

powercfg.exe -h on

which is useful if you really need hybernation. I use it all the time on my laptop, and Riley is using it in Alien too: