Synaptic doesn't free disk space after actions

Bug #21821 reported by Nathan Howell on 2005-09-16
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
synaptic (Ubuntu)
Medium
Michael Vogt

Bug Description

1. Before doing an upgrade or install of packages, check the free disk space for
the partition containing /var/cache/apt. I just run 'watch df -h' in a terminal
during the process.
2. Do your upgrade/install. Watch free space shrink while synaptic works.
3. When the upgrade/install finishes, note that you never got any space back
afterward.
4. Close synaptic. Ah, there's that free space.

http://bugs.debian.org/250583: http://bugs.debian.org/250583

Michael Vogt (mvo) wrote :

Thanks for your bugreport.

I assume you set "Settings/Preferences/Files/Temporary Files to "Delete
downloaded packages after install"?

Synaptic will clean the cache on close and "reload" (update). Is your bug report
about cleaing it right after a upgrade/install?

Cheers,
 Michael

Nathan Howell (neh) wrote :

I haven't changed that preference from the default (delete packages that are no
longer available).

It's not space consumed by the cached packages themselves, but temporary space
consumed during operations that is not being freed. For example, I just closed
synaptic after it had been running for a day or so, and I immediately got ~200MB
of free space back, while the size of /var/cache/apt didn't change. I only
noticed this bug because I had left synaptic running long enough (with repeated
reloads and upgrades) that / (I just use / and /home) ran out of space. As soon
as I quit synaptic I got almost 1GB back.

Michael Vogt (mvo) wrote :

Thanks, that's a different matter.

I can reproduce the problem here now. It looks like for some reason the mmap()ed
file /var/cache/apt/pkgcache.bin is not removed after it is rebuild/munmap().

Michael Vogt (mvo) wrote :

Synaptic uses the pkgcache.bin file from libapt. It looks like this file is not
freed on disk when synaptic rebuilds this cachefile (through libapt). Here is
the output of /proc/`pidof synaptic`/maps after three installs (each install
will trigger a cache rebuild):
2aaaafe63000-2aaaafe64000 rw-s 00c00000 08:01 2004246
/var/cache/apt/pkgcache.bin (deleted)
2aaab0a64000-2aaab0a65000 rw-s 00c00000 08:01 2004263
/var/cache/apt/pkgcache.bin (deleted)
2aaab0a65000-2aaab107e000 r--s 00000000 08:01 2004264
/var/cache/apt/pkgcache.bin

Michael Vogt (mvo) wrote :

Created an attachment (id=3978)
apt-pkg/contrib/mmap.h build with debug support output

Michael Vogt (mvo) wrote :

Created an attachment (id=3979)
The kernels view of the mmaped files

Michael Vogt (mvo) wrote :

This bug is fixed in my local apt tree and it will be part of the next upload.

Michael Vogt (mvo) wrote :

Fixed with the latest apt upload in breezy.

chepe (wmajano) wrote :

OK, i use debian and all i did was, login to the console and run apt-get clean and got 1.5 GB back

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.