If you’re not aware of what preload is, it’s a command line application that allows you to add files to ram, so they can be accessed faster by the applications that need them.

It seems to work well for what I’m using it for, which is to run games from slower storage devices, but there doesn’t seem to be any documentation for a proper way to remove the files once they’ve been added to ram. What I’ve been doing is to just use htop to terminate the preload command, but I feel like this is not intended at all. Is there a better way to remove these files?

I should mention that while trying to search for a solution myself, I did see gopreload mentioned a few times. I would try this out myself, but there’s no proper installation instructions, at least not any I could find that work in Linux Mint.

  • HelloRoot@lemy.lol
    link
    fedilink
    English
    arrow-up
    6
    ·
    4 hours ago

    Are we talking about this preload?

    https://manpages.ubuntu.com/manpages/jammy/man8/preload.8.html

    Cause if so, it doesn’t actually let you manually add specific files to RAM. It’s an adaptive daemon that automatically learns which files your applications use frequently over time and prefetches them. So when you launch it and then play games, it’s observing patterns and making predictions.

    This also explains why there’s no “remove files” command. The files preload loads into RAM aren’t locked there; they’re in the page cache, which the kernel manages freely. If something else needs that memory, the kernel will evict those cached files automatically. Killing preload via htop should not really do anything, except it not doing it’s thing anymore.

    • vortexal@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      When I used preload, it let me manually add files to ram. I used sudo preload filename for each file (the game I tried it with only had two) and it seemed to add them to ram. I know this because the game had hitching issues even after just adding the main executable but the hitching went away when I added the second file.