Opened 11 years ago

Last modified 5 weeks ago

#4843 assigned bug

Disabling VirtualMemory does not free up disk space

Reported by: Adek336 Owned by: leavengood
Priority: normal Milestone: R1.1
Component: Preferences/VirtualMemory Version: R1/Development
Keywords: Cc: hamish@…
Blocked By: Blocking:
Platform: All


hrev33753 gcc4+2 hybrid

Disable VirtualMemory, reboot, disk space still used by swap. Go to VirtualMemory preferences ; note that the size slider is not disabled. Anyhow, moving the slider to 1 MiB does not free up memory either. /boot/var/swap is still 2 GiB.

Removing the file frees up memory and doesn't introduce any problems or crashes.

Change History (7)

comment:1 by mmadia, 11 years ago

Version: R1/alpha1R1/Development

comment:2 by leavengood, 9 years ago

Owner: changed from axeld to leavengood
Status: newassigned

Taking ownership.

comment:3 by leavengood, 9 years ago

A user in IRC found this bug as well, but in his case deleting the file did not seem to actually free the disk space. Either way the system should remove or at least truncate to 0 the swap file when virtual memory is disabled.

I'll attempt to make the fix which does one or the other. It will be my first kernel change ;)

comment:4 by hamish, 9 years ago

The way you fix this is relevant to a patch I'm working on in #3723.

With support for swap on different volumes, simply deleting /var/swap at boot won't work. Also, deleting the swap file from the volume specified in the config won't work either, because the user could have changed the swap volume and rebooted, leaving a dormant swap file on the old volume.

I thought a possible solution might be to symlink /var/swap to wherever the swap file actually is, and delete through that at boot. This would require that the target volume be manually mounted and then unmounted for the deletion.

Ideally, there would be a procedure to switch off virtual mem at system shutdown which would make use of the existing swap_file_delete() function.

comment:5 by hamish, 9 years ago

Cc: hamish@… added

comment:6 by kallisti5, 8 years ago

#8971 opened to track the issue with the non-erased swap.

After the OS releases the swap, the file can be erased. (however, remember to empty the trash to regain the space!)

comment:7 by pulkomandy, 5 weeks ago

Milestone: R1R1.1
Note: See TracTickets for help on using tickets.