On 17-05-24 at 05:34, Rich Freeman wrote:
[..]
> Others have mentioned zram. I've used it, but unless something has
> changed one of its limitations is that it can't give up memory. That
> is less of an issue if you're using swap since it can be swapped out
> if idle. However, if you're not using swap then you're potentially
> giving up a chunk of RAM to do it, though less RAM than a tmpfs if it
> is full most of the time (which I doubt is typically the case).
Seems to work fine here (with kernels newer than the late 3.x when I started
using zram):
radiocarbon:~% dd if=/dev/urandom of=/tmp/foo
^C3405370+0 records in
3405370+0 records out
1743549440 bytes (1.7 GB, 1.6 GiB) copied, 10.8268 s, 161 MB/s
dd if=/dev/urandom of=/tmp/foo 8 MiB 10.853 (user: 0.339, kernel: 10.482)
radiocarbon:~% zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4 2G 4K 64B 4K 8 [SWAP]
/dev/zram1 lz4 3G 1.6G 1.6G 1.6G 8 /tmp
radiocarbon:~% free -m
total used free shared buff/cache available
Mem: 7920 3096 61 228 4763 4487
Swap: 2047 0 2047
radiocarbon:~% rm /tmp/foo
radiocarbon:~% zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4 2G 4K 64B 4K 8 [SWAP]
/dev/zram1 lz4 3G 3.9M 1M 1.3M 8 /tmp
radiocarbon:~% free -m
total used free shared buff/cache available
Mem: 7920 1412 3458 229 3049 6171
Swap: 2047 0 2047
--
Simon Thelen