LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-27-2016, 05:13 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 504

Rep: Reputation: 31
swap space vs tmpfs vs ramfs


Dear Friends ,

I have to read the below doc and get the few idea (but not clear idea) regarding the difference between ramfs,tmpfs and swap .

I have some below technical question regarding the above memory areas :

1) what will be the memory usage flow for an OS ? For example , when a system is started and give some load then which order it maintain for memory utilization , like tmpfs-->ramfs-->swap ?

2) As per doc, I understand that , both tmpfs and ramfs takes space from physical memory directly . In this case , please see the below output :

>>
----------------------------------------------------------------------
[root@STAN ~]# df -H /dev/shm/
Filesystem Size Used Avail Use% Mounted on
tmpfs 34G 40M 34G 1% /dev/shm



[root@STAN ~]# free -m
total used free shared buffers cached
Mem: 64449 64277 172 0 305 61475
-/+ buffers/cache: 2496 61952
Swap: 131069 22 131046
---------------------------------------------------------


In the above scenario , Total physical RAM is 64G and tmpfs 34G .As per doc ,If this 34G RAM takes from Physical RAM , then Physical RAM should be (64+38)=102 G. But here my physical RAM is 64 G.
Then from where the 'tmpfs' takes his space ?

3) In the above example, which is the ramfs value ? Both ramfs and tmpfs used together in an Unix OS ?


Waiting for kind rely ...
 
Old 12-27-2016, 06:27 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,723

Rep: Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739Reputation: 2739
Is this homework?
 
Old 12-27-2016, 07:18 AM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by shipon_97 View Post
Both ramfs and tmpfs used together in an Unix OS ?
If you where to take that question and plug it into Google, or similar search engine you'd find this,
Quote:
Linux

tmpfs is supported by the Linux kernel from version 2.4 and up.[4] tmpfs (previously known as shmfs) is based on the ramfs code used during bootup and also uses the page cache, but unlike ramfs it supports swapping out less-used pages to swap space as well as filesystem size and inode limits to prevent out of memory situations (defaulting to half of physical RAM and half the number of RAM pages, respectively).[5]
among other great ideas on how to do this and what it is about.

https://en.wikipedia.org/wiki/Tmpfs
 
Old 12-27-2016, 07:27 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Also notice the term "fs === file system."

This in contrast to "swap," which is low-level storage used by the virtual memory manager and which might either be a partition or a file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What if tmpfs space is full? Written to swap space? pstein Linux - Newbie 8 11-18-2012 06:51 AM
how to backup ramfs or tmpfs using dd penyu Linux - General 3 08-17-2012 05:21 AM
/etc/fstab "tmpfs /tmp tmpfs defaults 0 0" ramfs?! HOW? xcislav Linux - General 2 06-04-2011 03:03 AM
ramfs & tmpfs hadyy Linux - General 2 12-25-2007 02:16 PM
tmpfs and ramfs jatho Linux - General 0 06-23-2004 04:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration