It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
dtgreene: Linux actually has something like this; zram.

The zram creates a block device in memory that compresses data written to it and decompresses on read. By putting a swap partition here, one can get the OS to compress memory, which can be useful on some systems (I believe modern Android may use this by default; for older Android I believe it was a common tweak for rooted devices). Alternatively, you can make a filesystem on the device and use it as a compressed ramdisk.
I tried this out, and it had good results. Make any filesystem transparently compressed!

Though you can't tell it to re-compress the blocks better or anything, and you can't save the compressed data to disk or anything you only get the transparently decompressed portions. So it has it's flaws. Having the OS decide to compress memory via a compressed swap seems a good middle ground when using a ramdrive and having a lot of ram for speed, though once you start getting under 512MB free, i'd start getting worried as i have had a computer totally STOP... Because it's doing so much background work you can't get it to free memory/programs/files to fix the problem...

avatar
dtgreene: By the way, I can think of one good reason to use a ramdisk on a modern OS that has good disk caching (that is, not Windows XP). Using a ramdisk can prevent writes from ever reaching the disk; this can be useful if it's data that you don't care about (or even actively want to get rid of after use), and can save your disk some wear and tear. One could, for example, put the browser cache there (in fact, I am currently considering doing this for my Raspberry Pi 4, to see if it makes a difference). Ramdisks are also useful when running from read-only media, or, in the case of Linux, before the system has mounted the actual hard drive.
Ramdrive of temporary files... Yep... just need a script that runs during startup to make the ramdrive, make the directory and set your programs to use that space. Then you're probably good to go...
avatar
dtgreene: Linux actually has something like this; zram.

The zram creates a block device in memory that compresses data written to it and decompresses on read. By putting a swap partition here, one can get the OS to compress memory, which can be useful on some systems (I believe modern Android may use this by default; for older Android I believe it was a common tweak for rooted devices). Alternatively, you can make a filesystem on the device and use it as a compressed ramdisk.
avatar
rtcvb32: I tried this out, and it had good results. Make any filesystem transparently compressed!

Though you can't tell it to re-compress the blocks better or anything, and you can't save the compressed data to disk or anything you only get the transparently decompressed portions. So it has it's flaws. Having the OS decide to compress memory via a compressed swap seems a good middle ground when using a ramdrive and having a lot of ram for speed, though once you start getting under 512MB free, i'd start getting worried as i have had a computer totally STOP... Because it's doing so much background work you can't get it to free memory/programs/files to fix the problem...
If your kernel is recent enough, you can at least tell it to discard blocks that correspond to deleted files; just use fstrim, as the discard operation will be handled by the zram device.

Discard also works for many other devices in Linux, including loop devices (punching holes in the underlying files), many device mapper targets (passing it down to the device below, with some targets doing other things with the result (dm-thin); note that LVM uses the device mapper), and of course "raw" Solid State Drives (where the kernel actually sends the TRIM command to the physical drive).

If you find yourself getting worried about problems when low on RAM, you could try something like earlyoom.
avatar
dtgreene: By the way, I can think of one good reason to use a ramdisk on a modern OS that has good disk caching (that is, not Windows XP). Using a ramdisk can prevent writes from ever reaching the disk; this can be useful if it's data that you don't care about (or even actively want to get rid of after use), and can save your disk some wear and tear. One could, for example, put the browser cache there (in fact, I am currently considering doing this for my Raspberry Pi 4, to see if it makes a difference). Ramdisks are also useful when running from read-only media, or, in the case of Linux, before the system has mounted the actual hard drive.
avatar
rtcvb32: Ramdrive of temporary files... Yep... just need a script that runs during startup to make the ramdrive, make the directory and set your programs to use that space. Then you're probably good to go...
Or you can just put it in fstab, or even (on systemd systems) use a systemd mount unit.
Post edited August 12, 2020 by dtgreene
avatar
dtgreene: If your kernel is recent enough, you can at least tell it to discard blocks that correspond to deleted files; just use fstrim, as the discard operation will be handled by the zram device.
If the FS supports it.

Though if you zeroize blocks it does the same thing as all fully zero/null blocks are not allocated. So that works with say FAT16.

avatar
rtcvb32: Ramdrive of temporary files... Yep... just need a script that runs during startup to make the ramdrive, make the directory and set your programs to use that space. Then you're probably good to go...
avatar
dtgreene: Or you can just put it in fstab, or even (on systemd systems) use a systemd mount unit.
I was referring more for imdisk and on windows machines...
Post edited August 12, 2020 by rtcvb32
avatar
GameRacer: Would it be able to allow me to play games that need more memory for which my current memory isn't enough? Or is pagefile good enough for that purpose?
Readyboost would only help in providing faster access to small files (taking advantage of the lower seek-time of flash drives compared to HDDs). It would (in most cases) slow things down if your storage was SSD, and it doesn't provide any virtual RAM like a pagefile does. So in your case, it wouldn't help.

As an aside, how have you checked that lack of RAM is the underlying problem? (other possibilities include a slow GPU, a CPU that's slow or speed-throttled due to excessive heat and hard disk/SSD issues).
avatar
rtcvb32: ... just need a script that runs during startup to make the ramdrive, make the directory and set your programs to use that space. Then you're probably good to go...
Primo Ramdisk allows you to specify folders to be created on ramdisk creation and it runs early enough in the system startup process for NTFS junctions to be established from outside folders. You can't specify nested folders or copy data into them using this method, but you can have instead have an image file containing such data linked with the ramdisk (with numerous options for saving or discarding changes).
avatar
AstralWanderer: Primo Ramdisk allows you to specify folders to be created on ramdisk creation and it runs early enough in the system startup process for NTFS junctions to be established from outside folders. You can't specify nested folders or copy data into them using this method, but you can have instead have an image file containing such data linked with the ramdisk (with numerous options for saving or discarding changes).
Curious. Though i'd like to be able to attach ramdisks to directories as well though that would be few and far between.

So far i've had success making a few batch files that create drives of different sizes and configurations which i can discard afterwards, and you could just copy to the startup folder which will start after you log in.

Though Primo does sound promising. Though i'm fairly happy with imdisk so far.
I'm now fairly certain the program has a preferable influence for my system and the way i set it up.

The only change i made was instead of keeping the program running all the time i enable and disable the program when gaming.

Mass Effect Andromeda and Stellaris are 2 other games that don't run very fluid which ramcache III when running manages to minimize little hold ups with fast movements or scrolling a huge strategic map.

The reason i choose for disabling the program when not running was because of errors showing when multitasking with a download in progress

funny enough it does seem to influence games run from the pcie m.2 drive i use the most