Question: **Problem**

Many users (including me) found out from one moment to another that the usage disk space is really strange. One day I had 50Gb free and the next I had 3Gb, it is just crazy.

This happened with different versions of Ubuntu (11.04, 12.04 and 12.10 just to mention).

Some of those user have create question on this site, some of them:

* [Disk Usage Very Strange](https://askubuntu.com/q/69267/62483)
* [Ubuntu 12.10 recognizes me only 3GB of free space](https://askubuntu.com/q/206860/62483)
* [Why am I getting low disk space usage?](https://askubuntu.com/q/314710/62483)

**Solution**

[@NathanWienand](https://askubuntu.com/users/107984/nathan-wienand) have [discovered](https://askubuntu.com/a/217045/62483) that the problem was caused by the `.xsession-errors.old` file (it can be found on the $HOME directory) and he and others user solved the problem removing the file. An example of the size that can have this file is ~100Gb, not reasonable..

**Question**

* Why does this happen?
* Is deleting the file the only way to solve it?
* Isn't there another way to solve this with a large period effect?
* Does this problem affect only to 64 bits system's users?

---

If you have something to add here, feel free to edit the question.

Answer: 
You could investigate the problem. Yes, I know it's a big file, but by throwing away data and letting the computer do the work, one could: 

```
cat .xsession-errors* | \
    egrep -v '^$' | \
    sed -e 's/[0-9][0-9]\+/#NUM#/g'  | \
    sort | \
    uniq -c | \
    sort -rn | \
    tee counts.out | \
    less -XMersj3

```

Some messages (on my system without the problem) like: 

```
     38 /usr/share/software-center/softwarecenter/ui/gtk3/widgets/exhibits.py:#NUM#: Warning: Source ID #NUM# was not found when attempting to remove it
     38   GLib.source_remove(self._timeout)
     36 (nautilus:#NUM#): Gdk-CRITICAL **: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed

```

happen more often (38, 38, 36 times) than others, and therefore deserve more investigation. 

Others: 

```
 1 compiz (core) - Info: Loading plugin: ccp
 1 compiz (core) - Info: Loading plugin: animation

```

Another thing to do is to look for deleted, but still open files: 

```
 sudo lsof / | egrep 'PID|(deleted)'

```

Look for large SIZE/OFF values. 

And look for large open files: 

```
sudo lsof / | \
    awk '{if($7 > 1048576) print $7/1048576 "MB" " " $9 }' | \
    sort -n -u 

```
I am not sure why this happens, but this is a bit big for a comment. 

I would just stop them being created by running these command:

`rm .xsession-errors.old`

`touch .xsession-errors.old`

`sudo chattr +i .xsession-errors.old`

So delete the file, create a new one, and then set the immutable attribute to stop anything writing or reading it.

You will need to logout.

Hope it helps.