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