The problem is simple – for large application one need to restrict number of releases saved on production server because sometimes it takes huge amount of space. In my case it were 714 releases folder (for 9 months of running project).

On production server I use #ubuntu so to check out space usage we need to run:

df -h
# => Filesystem            Size  Used Avail Use% Mounted on
# => /some/path            1.4T  288G  1.1T  22% /

To check size of specific folder you can run:

du -hs /folder

h in this commands stands for human and displays sizes like 100M for megabytes for example.

As you can see there is more than 1Tb of free memory BUT it was vice versa before I cleaned up old releases. Actually we don't need to run rm -rf. If you use #capistrano for deploying application you can specify number of releases to keep like this:

set :keep_releases, 15
after "deploy:update_code", "deploy:cleanup"

So this is how I save freed 1Tb of memory (disk space).