truncate -s 100G /dev/shm/testfile && ls -lh /dev/shm && df -h |grep /dev/shm -rw-rw-r--. 1 roc roc 100G Mar 23 09:58 testfile tmpfs 16G 216M 16G 2% /dev/shm Go home Linux, you're drunk.
-
Show this thread
-
Ah, this is just a file with a hole in it.
2 replies 0 retweets 0 likesShow this thread -
OK, TIL that reading from a file with a hole via read() doesn't allocate space in it, but mmapping it and then reading from it (directly or via /proc/self/mem) DOES allocate space, even if it's a read-only mapping of a file opened read-only!
3 replies 8 retweets 15 likesShow this thread
Replying to @rocallahan
To be clear, this only happens on tmpfs, probably because tmpfs and the page cache are one and the same.
5:33 PM - 24 Mar 2019
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.