=== AndrewMC is now known as SpockVulcan
=== Mrokii_ is now known as Mrokii
=== SpockVulcan is now known as AndrewMC
=== Dave is now known as Guest53217
=== ziroday` is now known as ziroday
the_hydraok, I think I should just start now :)14:59
the_hydraallow me to introduce myself. I am Mulyadi Santosa, 31 years old15:00
the_hydracurrently resides in Indonesia15:00
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Current Session: Understanding fields in /proc/meminfo - Instructors: the_hydra
the_hydraand as you can easily guess, I use Linux daily ....15:00
the_hydraok, let's start with easy one "what is /proc/meminfo"?15:01
the_hydraand to answer that, you need to know what /proc is....15:01
the_hydrait's a pseudo filesystem15:01
the_hydrameaning, it doesn't exist in your disk...be it your hard disk, SSD, floppy etc15:02
the_hydrait is entirely created in memory...in run time,by the Linux kernel15:02
the_hydraso you see the content of /proc, just like any other normal directory15:02
the_hydra   /proc/meminfo holds almost all information you need about your virtual memory condition15:03
the_hydraand, perhaps it  might surprise you, tools such as top, vmstat, atop, htop and others parse /proc/meminfo to gather information about virtual memory15:04
the_hydraup to this point, any question?15:04
the_hydranone? ok let's continue15:05
the_hydraMemTotal....what is this field supposed to mean?15:05
the_hydrayour entire RAM?15:05
the_hydraanybody wanna bravely guess?15:06
koni_total RAM15:09
the_hydraok, it's actually total amount of RAM recognized and "mappable" by your kernel15:10
the_hydrathis might sound like a rocket science for seconds :)15:10
the_hydrawhat if I told you, that initially, linux kernel could only manage up to 896 MiB?15:10
the_hydrathis is due to ...what the geek call...virtual memory spliy15:11
the_hydrain 32 bit machine, in total, we could address up to 4 GiB...2^3215:11
the_hydrain this address space, linux kernel split it into two15:12
the_hydra3 GiB for user space, 1 GiB for the kernel itself15:12
the_hydraso within this 1 GiB space, kernel must fit everything regarding memory allocation15:12
the_hydraand you might further ask "ok 1 GiB..but you say 896 MiB? how's that?"15:12
the_hydrakernel...reserve more or less 128 for special needs15:13
the_hydraso, enough to say that, without additional "hacks", Linux kernel...initially could only address up to 896 MiB15:13
the_hydraso, for those of you who owns aging distro like redhat 5.2, don't scream if you put 4 GiB RAM module in your machine and scream "why on earth, it's just showing 896 MB? crap"15:14
the_hydraluckily, modern distro now equipped with default kernel which is able to address up to 4 GiB15:15
the_hydrathis is called highmem15:15
the_hydrahow about machine with RAM up to 64 GiB?15:15
flanOoh! Virtual MMU!15:16
the_hydraassuming your processor has PAE (Processor Address Extension) flag ( grep -i pae /proc/meminfo), just install pae kernel package15:16
the_hydraand kazaam, 64 GiB room for you15:16
the_hydrabut wait, you said 64 GiB..but uhm, this is 32 bit you know?15:17
the_hydrayeah, that's what PAE is...to "extend" addressing15:17
the_hydraslight pause here...any question?15:17
the_hydrathis is a generic knowledge, so it's not limited for Ubuntu and its family only...15:18
the_hydraevery Linux distro apply the same thing here...15:18
the_hydraflan, yeah MMU....15:18
the_hydraflan, you got it right :)15:18
the_hydraallow me to gently remind you, it's all described in my article...in Full circle magazine issue 39...page 14 to 2015:19
the_hydraso, in case you need longer explanation, you might download and read it there15:20
the_hydraok guys...I move again..15:20
flanTechnical question, asked only out of curiosity and not for practical relevance: would PAE emulate MMU functionality for devices that have no real MMU of their own?15:20
flanLike ancient Palms.15:20
the_hydranope AFAIK15:20
the_hydraPAE is PAE15:21
the_hydraMMU is MMU15:21
the_hydrain other word, without MMU, there won't be virtual memory15:21
the_hydraPAE just deal with addressing15:21
flanOkay, so it's a pre-requisite.15:21
the_hydrathink like this: MMU is like your office rooms15:21
the_hydrait segments a floor into smaller...ehm, how to say that..cubicles15:22
mhall119where are you going to get intel hardware without an MMU anyway?15:22
flanI was thinking ancient ARM.15:22
the_hydraflan, nice question anyway15:22
flanBut this is getting off-topic.15:22
mhall119PAE is an x86 only thing isn't it?15:22
the_hydraok, shall I continue?15:22
the_hydramhall119, AFAIK yes15:22
the_hydramhall119, but it could be named something else in other platform15:23
the_hydraok, memfree..this one is also confusing sometimes15:23
the_hydraagain, let me ask, what's your understanding about it?15:23
the_hydraone person at a time, ok? :D15:23
the_hydranobody? ok.... memfree is total amount of your RAM...100% unused for nothing!15:24
flanThe amount of memory not occupied by anything cached or loaded by the kernel.15:24
the_hydrasorry i mean, unused for every purpose15:24
the_hydraflan, thanks...that's almost similar like mine :)15:25
the_hydraok, so, in memfree, not just your application's allocated memory determines it, but also how much kernel does caching and any other kind of allocation15:26
the_hydraso if you see it and think "what? i just by my super dooper 16 GiB RAM stick and it is chewed down to 8 GiB in just few hours while I just sit and explore web using  my great firefox?"15:27
the_hydrathat's the answer....firefox allocates...kernel might do caching..and so on15:28
the_hydrabut that's good15:28
the_hydraand you might say "are you nuts???"15:28
the_hydrano I am not15:28
the_hydrathink like this: suppose you really have 16 GiB...and kernel use it to cache your recent read files for about 10 GiB (ok, this might sound exaggerating..)15:29
the_hydrathen, for next access, kernel will simply read from in-RAM cache instead of reading your disk15:29
the_hydraisn't that nice?15:29
the_hydrayou get speed up, people! :D15:30
flanBut I like hearing my HDD thrash. :(15:30
the_hydraflan, a strong magnetic iron will do that much quicker :D15:31
the_hydracoupling that, is buffer and cache15:31
the_hydraactually, they are more or less same thing15:31
the_hydra"page cache" a.k.a disk cache15:32
the_hydraso you sum them both, and you get the amount of RAM used for disk caching...15:32
the_hydrapretty simple...15:32
the_hydraok...no question so far?15:33
the_hydraI shall jump to Committed_AS15:33
the_hydraif you wanna know how much RAM your applications ask for memory, this is the indicator15:33
the_hydraplease notice, there is different between "how much an application ask" and "how much it is really allocated for now"15:34
the_hydracommitted_as reflect the first one...the "request"15:34
the_hydrathus, the higher this field, you know there is a memory chewing application running..especially when it constantly increase15:35
the_hydrabut it never exceed commitlimit15:35
the_hydrathis is the upper limit, dynamically set by kernel...that denotes how much virtual memory you can ask15:35
the_hydraso "great, you make me dizzy, please show me how much RAM is really allocated by my applications...."15:36
the_hydraAnonPages tells you that15:36
the_hydraAnon...short of Anonymous...is a technical way to say "a page that has no physical disk/file backing"15:37
the_hydraever use malloc() in C/C++, people?15:37
the_hydramalloc() is one of the function that ask for anonymous pages15:37
flanAlso new and del for C++, mirrored by higher-level languages, like Java.15:38
the_hydrapage itself is a smallest unit of RAM that a processor+MMU deal with your RAM15:38
the_hydrajust like sector in disk...15:38
the_hydraflan, yeap15:38
the_hydrabut...let me tell you, malloc() isn't directly allocate memory for you15:39
the_hydrait's just "asking"15:39
the_hydrathe real deal happen when you access the allocated memory for the first, hence triggerring what the kernel geek calls "page fault"15:39
the_hydraswap total and swap free...easy....swap total denotes your total *active* swap area15:40
the_hydrathe active ones...please notice that15:41
the_hydraso if you swapoff a swap area...it will be out of ring15:41
the_hydraswap free....the unallocated swap space from the active swaps15:41
flanQUESTION: What happens if you swapoff a partition while it's in use?15:41
the_hydra'til now, questions?15:41
the_hydraflan, first, kernel check if there is sufficient of free RAM that can contain the bits in there15:42
the_hydraso say, it holds 128 MiB of data15:42
the_hydrayour free RAM, must at least have that amount15:42
the_hydrabecause, if not, it must be kicked out again to swap....15:43
the_hydraagree here?15:43
flanYes, thus far.15:43
flanBut I'm really asking because I've never tried it.15:43
the_hydraand...dynamically, it will be swapped in to RAM15:43
the_hydrarelax, i did it hundreds of time :D15:43
the_hydraand read the codes in linux kernel...so I can tell :)15:44
the_hydraonce it all in RAM, that swap is detached15:44
the_hydrabut your application "don't feel it"15:44
the_hydrayou just feel few glitches....if there's any15:44
the_hydrain fact, doing swapoff -a followed by swapon -a (but please, do it carefully) is an easy way to bring all your swapped out pages back to RAM :D15:45
flanSo what if there isn't enough free RAM/other swap? Will the kernel refuse to complete the command?15:46
the_hydralinux kernel has tendency to swap out inactive pages...slowly to swap areas15:46
flan(Yay for vm.swappiness)15:46
the_hydrathus freeing precious RAM..for more useful things15:46
the_hydraflan, yes...correct15:46
the_hydraflan, correct again...15:46
the_hydrathe lower vm.swappiness is, everything will last longer in RAM15:47
the_hydraOTOH, the bigger it is (max is 100), it will be swapped out fairly fast15:47
the_hydrawhich one is ideal? up to you...but IMHO 60..the default...is already a nice number15:48
the_hydradid I say inactive?15:48
the_hydrayes, kernel marks pages which has been inactive for certain interval15:48
the_hydraand they are candidates to be swapped out15:48
flanYou were talking about active swap areas.15:49
the_hydranope, in-RAM15:49
flanOh, in terms of swap-propagation.15:49
the_hydrafor swaps, there is no active-inactive :)15:49
the_hydraactive..denotes portion of RAM that frequently accessed15:49
flanI should probably stop derailing your lesson.15:50
the_hydrathe field itself is splitted into 2, anon..and file15:50
the_hydraflan, we can continue in other related ubuntu chat room L)15:50
the_hydraanon...is the anonymous15:50
the_hydraand ...file? ok, remember when I talk about cache? this is it..along with the so called file memory mapping15:51
the_hydrathis sounds geek ...but really you see it everyday15:51
the_hydralibrary loading...primarily :)15:51
the_hydraso, big anon...aggresive malloc()15:51
the_hydrabig file (both active and inactive), could be aggresive library loading etc15:52
the_hydraunevictable...mlocked..are portion of RAM that is made unswappable15:53
the_hydramost likely, it is allocated by kernel for special need15:53
the_hydraor if you're multimedia people who works on audio recording etc, this number might rise...15:53
the_hydrait is a standard way to lessen latency15:53
the_hydraby locking allocated memory to be always in RAM, it's guaranteed that the access time is fast...because if it hits swap..well you know the consequences :D15:54
the_hydraok, quite fast I guess...questions?15:54
the_hydrai selected the most important fields so far...15:54
the_hydrathis is really linux memory management 101 :D15:55
the_hydrai feel like mel gorman junior :D15:55
the_hydraok ...i guess time still permits15:56
the_hydraoh my god, dirty? dirt in my RAM15:56
the_hydraenough to say that, when you write something to disk, it's not done right away15:56
the_hydramost likely, it's deferred15:56
the_hydraportion of RAM that contains bits that haven't been pushed back to the related files..is said to be dirt15:57
the_hydrathus, the higher this number might mean : your disk is busy...or something is not optimal with write back operation15:57
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
flanThank you very much, the_hydra. I definitely learned a few things I didn't know about today. :)16:01
the_hydrathat would be a great honour16:01
=== efm_ is now known as efm

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!