{"id":13730222,"url":"https://github.com/FRex/rampin","last_synced_at":"2025-05-08T02:32:04.855Z","repository":{"id":69478620,"uuid":"189528867","full_name":"FRex/rampin","owner":"FRex","description":"Try to make Windows preload files into RAM by memory mapping and touching them.","archived":false,"fork":false,"pushed_at":"2021-02-20T15:23:14.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T21:37:52.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FRex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-05-31T04:43:33.000Z","updated_at":"2023-07-24T12:25:25.000Z","dependencies_parsed_at":"2023-04-20T12:18:57.783Z","dependency_job_id":null,"html_url":"https://github.com/FRex/rampin","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRex%2Frampin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRex%2Frampin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRex%2Frampin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FRex%2Frampin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FRex","download_url":"https://codeload.github.com/FRex/rampin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252986897,"owners_count":21836250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:11.765Z","updated_at":"2025-05-08T02:32:04.571Z","avatar_url":"https://github.com/FRex.png","language":"C","readme":"# rampin\n\nA small C program to try keep a file or few in Windows RAM cache. For a Unix\n(not only Linux) alternative see [vmtouch](https://linux.die.net/man/8/vmtouch).\n\nTakes one or more filenames as arguments, opens them as read only and memory\nmaps them whole, then accesses each 4 KiB page of it to bring them into memory\nand then sleeps for 30 seconds and accesses them again to keep them in memory.\n\n**By default it never quits so you'll have to somehow kill it once you are done.**\n\nA sole `-h` will print full help to stdout. Options `-0`, `-1`, etc. up to `-9` will\nmake it quit after that many sleep + touch loops, not counting the initial one\nso `-0` will map the file, touch all pages once, and quit right after, `-1`\nwill map, touch once, and sleep once and touch again and then quit, etc.\n\nThis program only makes sense if you have RAM to spare and/or are on 64-bit. I\nwrote it to speed up level loading in an old game that has a total of 5 GiB of\nassets and a 32-bit exe, so the game, OS and all the assets fit into my PC's RAM.\n\n**This program might easily backfire if used too greedily and your OS might start paging to disk!**\n\nTo make it easier to rampin entire dir tree I use this help script named `rampintree`,\nbut mapping and touching many files one after another has been added recently to the\n`rampin` program itself so just `rampin *` or `rampin` + list of files works too.\nYou can write a similar script in Powershell, Batch, pure sh and Busybox, etc.\n\nIn the future `rampin` will likely offer an option to recurse directories on its\nown (if you need that option now you can open an issue here to let me know).\n\n```\n#!/bin/bash\n\nif [ \"$#\" -eq 1 ]\nthen\n    find \"$1\" -type f | xargs -P 99000 -I @ rampin @\nfi\n```\n\nThe above might work poorly and cause lower reading speeds on an HDD. For an\nHDD a script that reads files one by one (and uses only one process) could be:\n```\n#!/bin/bash\nif [ \"$#\" -eq 1 ]\nthen\n    rampin `find \"$1\" -type f`\nfi\n```\n\nGo to releases to download a Windows exe compiled with Pelles C with no `-O2`\nto avoid running into any `-O2` optimizer bug similar to this one that affected\n`stb_image`: [Pelles C forum bug report](https://forum.pellesc.de/index.php?topic=7837.0)\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFRex%2Frampin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFRex%2Frampin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFRex%2Frampin/lists"}