You should probably not have created any RAM disk (i.e. use tmpfs
not ramfs
), see this. Linux is managing RAM better than you can, and its page cache is very good (so you might not need to create any "RAM" disk, just use a tmpfs
mounted /tmp
and put your file there, or even any file in any file system: with a lot of RAM very often the data stays in the page cache and no actual disk IO is involved, but see sync(2). See linuxatemyram and my answer to your previous (confusing) question.
And "assigning a RAM disk to a specific process" is impossible on Linux; you probably should explain the use case. a RAM disk is generally a tmpfs filesystem (or perhaps an obsolete ramfs one) so you assign it to a file system, not a single process.
You could probably limit most of the other processes using your Linux. For example, use the ulimit
shell builtin (based upon the setrlimit(2) syscall)
How can i be sure that this RAM Disk is only used by the mentioned process and other processes wont change its data?
The kernel should guarantee the tmpfs
file system (like it is guaranteeing other file systems). Only processes accessing files in that file system can change the data inside them.
If you can change the code of the program of the specific process you want to favor, use mlock(2).
See also ionice(1) & nice(1)
I guess that if you did not create any RAM disk, your Linux system will perform (or can be configured to perform) better than with explicit RAM disk.
You won't get any help unless you show the exact commands, and some code dealing with your issue.
mlock
to lock it in RAM, rather than trying to make a RAM-resident filesystem do what you want here. – Mark Plotnick Jul 23 '15 at 14:17