The file path /tmp/whatever
does not guarantee anything. What you need to do is log into your Beaglebone and see what filesystems are mounted where.
In order to store files in RAM you need to store them on a tmpfs
or ramfs
filesystem.
On my Fedora Linux laptop if I type mount
or cat /proc/mounts
I see everything that is mounted. These are the kinds of lines you're looking for:
$ grep tmpfs /proc/mounts
tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0
tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0
tmpfs /tmp tmpfs rw,seclabel,nosuid,nodev 0 0
So you can see that on Fedora anyway, the /tmp/
directory is a tmpfs
and the files in /tmp/
will be in RAM.
One thing to watch for with tmpfs
is that the default maximum size is half of RAM. If a file in tmpfs, plus programs using RAM exceeds the RAM size the tmpfs
data will go into swap, which will be on Flash, if a Beaglebone even has swap, which I don't remember at the moment.
If there's no swap or it is small then using a tmpfs for big files will cause OOM (out of memory) and break a lot of things so be careful how much you use.