WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How does memory management work?  (Read 5590 times)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How does memory management work?
« Reply #15 on: February 04, 2013, 10:29:39 AM »
So to clarify - every program/library/resource loaded into the operating system is loaded into the RAM - so TC is kinda crippled if you want to run something like Photoshop (if it were possible) or some other large program?
Such used to be the case with ramdisks, but is no longer so with tmpfs as long as you provide enough swap space, so data stored in cache can be swapped out by kernel upon mem requirement of apps. 
Quote
What is also blurry is how the applications get extracted from there squash file system? where are they extracted to, in RAM or on disk?
Nowhere, with exception of Copy Mode, in both Default and Mount Mode they are mounted and content is symlinked into tmpfs.
Quote
I'm still researching and learning about Linux and Unices, but I still have tons to learn still.
tonight I'll look through some of the scripts and check out how things tick.
Maybe you would benefit most by reading up about filesystems (initramfs, tmpfs, squashfs etc.)  ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How does memory management work?
« Reply #16 on: February 04, 2013, 05:19:44 PM »
So to clarify - every program/library/resource loaded into the operating system is loaded into the RAM - so TC is kinda crippled if you want to run something like Photoshop (if it were possible) or some other large program?
So just a bit ago I happened to observe a condition providing proof that there is no such concern when
an app started to have heavy mem requirements:

Code: [Select]
tc@box:~$ \df |grep tmpfs
tmpfs                   462888     29976    432912   6% /
tc@box:~$ grep Cached /proc/meminfo
Cached:             8252 kB
SwapCached:        94668 kB
meaning that out of 29976kB of data in my tmpfs at most 8252kB were remaining in RAM.

Measuring again after the app was exiting and thus freeing up a lot of mem:
Code: [Select]
tc@box:~$ grep Cached /proc/meminfo
Cached:            27368 kB
SwapCached:         8032 kB
most of the data in my tmpfs was residing in RAM.

Note: above on system with vm.swappiness = 100
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline naf456

  • Newbie
  • *
  • Posts: 11
    • Humbell
Re: How does memory management work?
« Reply #17 on: February 07, 2013, 05:14:00 AM »
Thanks for all your help.
I'm going to read into tmpfs and squashfs in more detail. ^_^

EDIT: Does TC use swap? or does it just use the partition on which it is install on? I say this because I haven't setup a swap.
Going to my root filesystem, it says that it's mounted 4.6GB or data, while my computer only has 2 GB of RAM , while top says only 1GB of my ram is being used?
Meaning 3.6GB of data is being pumped from my HDD somehow.

I read briefly about initrmfs/tmp And it states that it requires swap? :o
« Last Edit: February 07, 2013, 05:44:13 AM by naf456 »
“Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover" - Mark Twain

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14803
Re: How does memory management work?
« Reply #18 on: February 07, 2013, 06:08:40 AM »
If you have a swap partition and the partition is enabled (swapon), then tinycore will use the swap partition. If you don't have a swap partition and you have enough ram, tinycore will manage fine without it.

Code: [Select]
$ sudo fdisk -l..should show if there is a swap partition present
« Last Edit: February 07, 2013, 06:13:43 AM by Juanito »