Guillaume S
Guillaume S

Reputation: 1490

Linux use disk as ram for a process

I want to know if it's possible on linux to specify for a process to use disk as RAM. For exemple create a file and tell to a program to use this file as RAM.

Thanx

Upvotes: 0

Views: 329

Answers (1)

datenwolf
datenwolf

Reputation: 162164

See the manpage for the mmap(2) syscall. Note that if just need "more memory" then using a swap file or swap partition is much, much easier.

EDIT: Tried to come up with simple and easy demonstrator code and seems like it's not that easy to implement per process swap limits, without falling down a syscall rabbit hole.

Upvotes: 1

Related Questions