ecdye / zram-config

A complete zram-config utility for swap, directories, and logs to reduce SD, NAND and eMMC block wear.
MIT License
412 stars 53 forks source link

How about adding a fomula to allocate memory like this? #34

Closed yutayu closed 4 years ago

yutayu commented 4 years ago

https://github.com/novaspirit/rpi_zram/blob/master/zram.sh

StuartIanNaylor commented 4 years ago

There is no need to split via cores as zram is multistream and all cores can access a single zram device. You can add as much ram to zram as you wish and because application varies so much there isn't a formula apart from 50-25% is prob a good initial guestimate. Disk size is very dependent on alg chosen to expected compression.

yutayu commented 4 years ago

I am sorry, I mean this line. mem=$(( ($totalmem / $cores) 1024 )) for example, 50% disksize mem=$(( ($totalmem /2) 1024 ))

now,we can set disksize as we like without fomula.

StuartIanNaylor commented 4 years ago

You can but zram-config runs a ztab so multiple devices and disks can be setup. Its zram-config which has multiple uses for zram and not just zram-swap. If it was just zram-swap then I would agree

yutayu commented 4 years ago

https://github.com/StuartIanNaylor/zram-swap-config MEM_FACTOR=50

I mean this .very sorry lol