WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Reducing RAM load ?  (Read 3325 times)

Offline labeas

  • Sr. Member
  • ****
  • Posts: 266
Reducing RAM load ?
« on: March 28, 2017, 12:11:34 PM »
LinuxNativeOberon which is like a whole OS, giving full-color
images..etc., in the FrameBuffer, ie. down in any of the multiple
VTs, also runs in RAM.    So I've got a big load on RAM.

I'm writing this now in LNO.      It recently crashed, after a trap
message, suggesting <out of RAM> which I've never seen before,
and unfortunately didn't think of save/pasting here.
---
System.Watch                <- means list <memory spaces>
        SYS: 4160KB of 9724KB free
        Linux: 4094MB of 5130MB free
        Heap has 440KB of 2944KB free (309KB contiguous)
----
SYS: is a RAMdisk, and Heap is also RAM.
Interestingly the command which caused the crash:
  Base64.Decode id.jpg ^        decodes from the selection to id.jpg
Wow ! :  Desktops.OpenDoc id.jpg
shows the color-image [in VT]!  And less RAM is free:
        SYS: 3200KB of 9724KB free
        Linux: 4094MB of 5130MB free
        Heap has 3109KB of 9728KB free (1412KB contiguous)

Similarly, as I load extra TC-extensions for use there can't be
automatic/dynamic loading, where a newly called program,
replaces space used by an inactive one. So far, I haven't been
using the <official management sysytem>, [partly because of the
poor documentation: eg. reference to non existing /cde  file]
--
Let's do another:   Base64.Decode Employed.doc ^
 which decodes the M$:Employed.doc embedded in an old email;
 and shows its plainText embedded in the M$:*.doc

Similar to TC:
System.Directory SYS:*.doc   == Employed.doc
confirms that the files generated by:
 Base64.Decode <fileName> ^
are in the SYS:<space>. Ie. RAM and will be lost on power down,
unless save to disk. eg. to Linux: .

And some more:  use-up LNO's RamDisk.
 Base64.Decode image001.jpg ^
 gives a nice color image.

  Base64.Decode CCE18102012.jpg ^
== JPEG: image too large (4)
and `System.Watch` shows the decreasing available RAM:
        SYS: 4160KB of 9724KB free
    SYS: 3200KB of 9724KB free
        SYS: 2840KB of 9724KB free
How does TC manage its similar problem?

LNO's RAMdisk is Fixed to the configured size.
I'm guessing that TC's is not, because it makes extra loop-files,
as more apps are installed. Is that right ?

Does it cycle some apps out-of-RAM to make space for newly
called ones?
 

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Reducing RAM load ?
« Reply #1 on: March 28, 2017, 03:17:33 PM »
Quote
So far, I haven't been
using the <official management sysytem>, [partly because of the
poor documentation: eg. reference to non existing /cde  file]
You mean APPS, or tce-load, etc. etc.?   Usually spells disaster when folks try to download and install themselves via wget and similar, just saying..

I suggest using the forum Search feature to find items which have little explanations in the Wiki etc. etc.  The Wiki is user contributed and covers the basics.   FYI cde most definitely exists, specifically cde is used in a read only environment as a replacement for tce directory.  eg. an ISO, or CD etc. etc.

I suggest reading the Core Book again http://tinycorelinux.net/book.html to understand how TC works.

Remember this is not your typical Linux Distro, think of it as a foundation to built your flavor of Linux exactly the way you like it.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Reducing RAM load ?
« Reply #2 on: March 28, 2017, 03:40:32 PM »
Hi Labeas,

I have no experience with LNO, so I can't really draw comparisons but I have a good handle on how TinyCore does things.

You can explicitly specify that you want particular extensions (or all extensions) loaded into RAM (copy to fs, with the fs being in RAM) but as long as you don't do that, and as long as you are not in "cloud mode" (where even the tce directory is in RAM),extensions take up very little RAM.

This is achieved by mounting the .tcz files rather than copying the their contents into the (in RAM) filesystem.  Then symbolic links (which take up very little space) are created to make the files in the mounted extension appear in the expected places in the filesystem.  The "loop files" you see are the mounted extensions and ps will list a process for each of them as well.  tce-load -i handles this all automagically, as does the graphical apps tool.

Actually -running- a large application can take up a good bit of RAM, but the normal use of swap space helps there - it's not related to the RAM disk.



32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline labeas

  • Sr. Member
  • ****
  • Posts: 266
Re: Reducing RAM load ?
« Reply #3 on: April 01, 2017, 12:54:51 PM »
Re. SymLink: for read/write of a file; that can be done in a stream
[one byte at a time], but execution eg. needs to be CONDITIONALLY able
to Jump back or Forwards to not yet fetched code ? Kernel complexity?

I've d/l-ed "The book" but it makes less sense than your explanation.
What is the syntax to run an app from non-volatile memory?

Initially, while I was not able to d/l on line, I needed to fetch the
files via M$ and eg. I've such sections in my Setup script:-----
echo " INSTALL mc "
tce-load -i /mnt/sdb1/tce/optional/libgpg-error.tcz
tce-load -i /mnt/sdb1/tce/optional/libgcrypt.tcz
tce-load -i /mnt/sdb1/tce/optional/libssh2.tcz
#tce-load -i /mnt/sdb1/tce/optional/pcre.tcz
#tce-load -i /mnt/sdb1/tce/optional/libffi.tcz
#tce-load -i /mnt/sdb1/tce/optional/glib2.tcz
tce-load -i /mnt/sdb1/tce/optional/slang.tcz
tce-load -i /mnt/sdb1/tce/optional/mc.tcz
---------------
SymLinking would also solve a big problem of programs losing their user
chosen setups. With mc I tried to write the setup DirTree to
non-volatile, but I don't know the syntax for <copy SrcTree DestTree>
precisely because I've always used mc to do so!! What is the syntax ?

And what's the syntax for <SymLink loading> the set of *.tcz for a
particular program ?

== TIA.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Reducing RAM load ?
« Reply #4 on: April 01, 2017, 01:04:59 PM »
All you need is "tce-load -i mc"  Dependencies will be automatically loaded.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Reducing RAM load ?
« Reply #5 on: April 02, 2017, 06:18:10 AM »
To load MC you need

Code: [Select]
mc.tcz
   glib2.tcz
      gamin.tcz
      libffi.tcz
   libssh2.tcz
      libgcrypt.tcz
         libgpg-error.tcz
   slang.tcz
      pcre.tcz
         bzip2-lib.tcz
as per the mc.tcz.dep file

You'll need to download all the above and their dep files if they exist. 

Looking at the above, I expect this list of files will need downloading at a minimum (if you want tc to run as intended then you should additionally download each extension's md5 file)

mc.tcz
mc.tcz.dep
glib2.tcz
glib2.tcz.dep
gamin.tcz
libffi.tcz
libssh2.tcz
libssh2.tcz.dep
libgcrypt.tcz
libgcrypt.tcz.dep
libgpg-error.tcz
slang.tcz
slang.tcz.dep
pcre.tcz
pcre.tcz.dep
bzip2-lib.tcz


As Gerald has said already, with the above files installed to your tce diretory, run only
Code: [Select]
tce-load -i mc
mc

« Last Edit: April 02, 2017, 06:30:38 AM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Reducing RAM load ?
« Reply #6 on: April 02, 2017, 09:44:48 PM »

Offline labeas

  • Sr. Member
  • ****
  • Posts: 266
Re: Reducing RAM load ?
« Reply #7 on: April 03, 2017, 12:07:35 AM »
Yes: the possibilities/combinations hence complexity is exploding exponentialy!