Opened 15 years ago

Closed 5 weeks ago

#4843 closed bug (fixed)

Disabling VirtualMemory does not free up disk space

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

Description

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 (10)

comment:1 by mmadia, 15 years ago

Version: R1/alpha1R1/Development

comment:2 by leavengood, 13 years ago

Owner: changed from axeld to leavengood
Status: newassigned

Taking ownership.

comment:3 by leavengood, 13 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, 13 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, 13 years ago

Cc: hamish@… added

comment:6 by kallisti5, 12 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, 4 years ago

Milestone: R1R1.1

comment:8 by diver, 3 months ago

Blocking: 18971 added

comment:9 by diver, 3 months ago

Milestone: R1.1R1/beta6

comment:10 by waddlesplash, 5 weeks ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev58195. There are still issues with resizing or disabling at runtime, but at least the space will be released after a reboot now. The remaining issues are tracked in #7550 and #8971.

Note: See TracTickets for help on using tickets.