WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: RAM limitation?  (Read 5578 times)

Offline labeas

  • Sr. Member
  • ****
  • Posts: 266
RAM limitation?
« on: February 23, 2018, 03:01:14 PM »
Some time ago, I thought my TC64's USB main partition was nearly full,
so I started cleaning it. But now I see:
/dev/sdb2        5253408  2264748   2698760  46% /mnt/sdb2
    which shows MUCH more free space than I though I casually made?
Related: opera-12 has started to scroll very slowly; as if memory
transfers are extremely delayed.

Does RAM get cycled to USBstik [as a swap partition] as RAM fills?
If so, it would be good to remove redundant <RAM loops> ?
eg. df shows: .................
/dev/loop29         1052     1052         0 100% /tmp/tcloop/gcc_libs
  and I don't use/have gcc [which may be used by other apps], but
just in principle: what's the correct procedure to free-up some RAM ?

==TIA.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RAM limitation?
« Reply #1 on: February 24, 2018, 01:10:23 AM »
You could check to see if your backup contains home/tc/.opera/ or use bigHomeFiles.sh to check for similar large files that you could add to .xfiletool.lst

If you don't have the "noswap" boot code, it is possible that you are using swap - it should show up using the "free" command.
« Last Edit: February 24, 2018, 02:16:14 AM by Juanito »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: RAM limitation?
« Reply #2 on: February 24, 2018, 10:46:24 AM »
just in principle: what's the correct procedure to free-up some RAM ?

Code: [Select]
sudo cache-clear

Offline labeas

  • Sr. Member
  • ****
  • Posts: 266
Re: RAM limitation?
« Reply #3 on: February 24, 2018, 06:39:35 PM »
> You could check to see if your backup contains home/tc/.opera/ or.
> use bigHomeFiles.sh to check for similar large files that you could
> add to .xfiletool.lst

> If you don't have the "noswap" boot code, it is possible that you are
> using swap - it should show up using the "free" command.
   << Last Edit: February 23, 2018, 11:16:14 PM by Juanito >>
-----
This is the entry I use in <syslinux>:---
Code: [Select]
KERNEL /boot/vmlinuz64
INITRD /boot/corepure64.gz
APPEND loglevel=3 cde vga=788 multivt
----
I don't remember mention of swap in USBstik based Linux?.
------------------------------------------------------------------
    Offline polikuo
   Quote from: labeas on February 23, 2018, 12:01:14 PM

>> just in principle: what's the correct procedure to free-up some RAM ?

>   Code: [Select]
>   sudo cache-clear
Well no: AFAIK <cache knows that it's only got a temporary life>,
whereas, like my case, if <gcc.tcz> is loaded into <RAM loop> but
never used, it should be removed and not wrongly loaded in future ?
-----
Code: [Select]
root@box:/home/tc# free
             total       used       free     shared    buffers     cached
Mem:       1912128     385992    1526136      51508      36692     202972
-/+ buffers/cache:     146328    1765800
Swap:       462840          0     462840
root@box:/home/tc# mount | grep swap
root@box:/home/tc# cache-clear
root@box:/home/tc# free
             total       used       free     shared    buffers     cached
Mem:       1912128     206924    1705204      51508         72      72996
-/+ buffers/cache:     133856    1778272
Swap:       462840          0     462840
-----
I've been in & out of TC64, since [was it?] yesterday and the bad.
symptom has now disapeared.
The principles of <swap> were designed before the days of USBstiks.
Surely NOW swap can only be to my USBstik; which is bad, since it
wears drastically more than an original/assummed <spinning disk> ?

Does this look correct ? -------------------
Code: [Select]
# /etc/fstab
proc            /proc        proc    defaults          0       0
sysfs           /sys         sysfs   defaults          0       0
devpts          /dev/pts     devpts  defaults          0       0
tmpfs           /dev/shm     tmpfs   defaults          0       0
/dev/zram0  swap         swap    defaults,noauto   0       0   <--?
/dev/sda1       /mnt/sda1       ntfs     noauto,users,exec,ro,umask=000 0 0 # Added by TC
/dev/sda2       /mnt/sda2       vfat     noauto,users,exec,umask=000 0 0 # Added by TC
/dev/sda4       /mnt/sda4       ntfs     noauto,users,exec,ro,umask=000 0 0 # Added by TC
/dev/sdb1       /mnt/sdb1       vfat     noauto,users,exec,umask=000 0 0 # Added by TC
/dev/sdb2       /mnt/sdb2       ext4     noauto,users,exec    0 0 # Added by TC
/dev/sdc1       /mnt/sdc1       ext2     noauto,users,exec,relatime 0 0 # Added by TC
/dev/sdc2       /mnt/sdc2       reiserfs noauto,users,exec    0 0 # Added by TC
/dev/sdc3       /mnt/sdc3       ext3     noauto,users,exec,relatime 0 0 # Added by TC
/dev/sdc4       /mnt/sdc4       ext3     noauto,users,exec,relatime 0 0 # Added by TC
/dev/sdd1       /mnt/sdd1       vfat     noauto,users,exec,umask=000 0 0 # Added by TC
/dev/sde1       /mnt/sde1       vfat     noauto,users,exec,umask=000 0 0 # Added by TC
/dev/sde2       /mnt/sde2       ext4     noauto,users,exec    0 0 # Added by TC
/dev/sde3       /mnt/sde3       ext4     noauto,users,exec    0 0 # Added by TC
/dev/sr0        /mnt/sr0        auto     noauto,users,exec    0 0 # Added by TC
-----------------

TIA.
PS. I don't think I'm running <V8> yet.
There was some complication when testing the update and I needed to USE
the system. There's a lot of chaos with inet-connecting in this
 <Trump-shit-hole location>.

    [EDIT]: Added code tags.  Rich
« Last Edit: February 24, 2018, 08:12:19 PM by Rich »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: RAM limitation?
« Reply #4 on: February 24, 2018, 07:37:00 PM »
-----
This is the entry I use in <syslinux>:---
 KERNEL /boot/vmlinuz64
 INITRD /boot/corepure64.gz
 APPEND loglevel=3 cde vga=788 multivt
----
I don't remember mention of swap in USBstik based Linux?.
------------------------------------------------------------------

The first and most important task is to fix your installation.   Where have you installed the TCE directory?  because "cde" in your command line instructs tinycore to load extensions from a CD !!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RAM limitation?
« Reply #5 on: February 25, 2018, 12:27:40 AM »
You also appear to be confusing the gcc extension with the gcc_libs extension - the latter is a dependency of several other extensions.

What was the result of running "bigHomeFiles.sh"?

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 776
Re: RAM limitation?
« Reply #6 on: June 08, 2018, 12:44:05 AM »
If you're looking to see if you have things installed which you have no idea if you need or don't need:

Assuming you know your way around a little in the shell, here's a script that will detect "stragglers" (TCZ files which are there, just not being used in tce/optional). As noted by Juanito, gcc.tcz and gcc_libs.tcz are quite different. gcc_libs you may likely need (see the following script) whereas gcc is only going to usually be needed if you're compiling something (lol - or if another extension compiles something :) )

Look inside /etc/sysconfig/tcedir/onboot.lst - this is your list of extensions which have been directly installed (things you should "know" you have installed in most cases.)  If you look inside /etc/sysconfig/tcedir/optional you'll see a good number more files there than are listed inside onboot.lst -- these will be dependencies of those items which ARE inside onboot.lst.  The script below will determine if any of those dependency files are no longer needed (that we know of) unless you have something installed which does its own thing and puts stuff in there without going through the proper channels.

1. Copy the following into a text file and save it to /tmp/cleaner.sh or similar
2. Within the shell/terminal launch the script by typing in sh /tmp/cleaner.sh
3. If things are found which don't appear to be needed, it'll list the tcz's in question
Code: [Select]
#!/bin/sh
################################################################################
# Title:          cleaner.sh                                                   #
# Description:    Script to look for unneeded tcz extensions (not ondemand)    #
# Version:        1.00.00                                                      #
# Author:         T.J. Glawitsch                                               #
# Original-site:  http://www.centralware.com                                   #
# Copying-policy: GPL v2                                                       #
# Size:           4 KB                                                         #
# Extension_by:   CentralWare Development Centers                              #
# Tags:           CLI SYSTEM EXTENSION RAM                                     #
# Comments:       This script does NOT remove extensions, only looks for them  #
# Change-log:     ----                                                         #
# Current:        2018/06/08 First version                                     #
################################################################################

clear
################################################################################
# The goal with this little script is to test "What's Installed" with "What I  #
# Expect To Be Installed" by comparing onboot.lst (items which we've ASKED for #
# to be there) and by using tce/optional directly we can compare to see what's #
# here and those which do not have to be.                                      #
################################################################################

################################################################################
# Let's start off by taking the items in onboot.lst (and their dependencies)   #
# and create temporary (empty) files in /tmp/somewhere just as place-holders   #
################################################################################
tcepath=/etc/sysconfig/tcedir
tcedir=$(readlink $tcepath)                 # This SHOULD apply to all TCL's

noTCE=0
if [ ! -d $tcepath/optional ]; then noTCE=1; fi
if [ ! -d $tcedir/optional ]; then noTCE=1; fi

if [ ! $noTCE == 0 ]; then
    echo "There was a problem locating your TCE directory"
    echo "(normally found in /etc/sysconfig/tcedir)"
    echo "Operation Aborted."
    exit 1
fi

TMP=/tmp/somewhere; mkdir -p $TMP; rm $TMP -fR; mkdir -p $TMP

cd $tcedir/optional
for file in *.tcz
do
    if [ -f $tcedir/optional/$file.dep ]; then
        cp $tcedir/optional/$file.dep $TMP
    else
        touch $TMP/$file.dep
    fi
done

################################################################################
# We now have a collection of DEP files in /tmp/somewhere which we want to see #
# if they're NEEDED by items within onboot.lst                                 #
################################################################################

read_dep()
{
    while read line
    do
        if [ ! "${line}" == "" ]; then
        if [ ! -f $TMP/$line.dep.old ]; then mv $TMP/$line.dep $TMP/$line.dep.old; fi
            if [ -f $tcedir/optional/$line.dep ]; then
                read_dep $line.dep
            fi
        fi
    done < $tcedir/optional/$1
    if [ ! "${line}" == "" ]; then read_dep $line; fi
}

while read -r line
do
    line=${line/-KERNEL/-$KERNEL}
    if [ ! "${line}" == "" ]; then
        if [ ! -f $TMP/$line.dep.old ]; then mv $TMP/$line.dep $TMP/$line.dep.old; fi
        if [ -f $tcedir/optional/$line.dep ]; then
            read_dep $line.dep
        fi
    fi
done < $tcedir/onboot.lst
if [ ! "${line}" == "" ]; then read_dep $line; fi

echo
cd $TMP; rm *.dep.old -f; test=`ls -1`
if [ ! "${test}" == "" ]; then
    echo "Extensions foung which may not be needed:"
    for item in $test
    do
        echo $item
    done
else
    echo "All extensions check out with what's listed in onboot.lst"
fi

echo
echo "Press ENTER to exit"; read empty


Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: RAM limitation?
« Reply #7 on: June 08, 2018, 06:59:21 AM »
Extensions foung which may not be needed:

I wonder what "foung" is.  :D

if [ ! "${line}" == "" ]; then

Suggestion: use [ "$(echo $line)"  ] instead of [ ! "${line}" == "" ]
Code: [Select]
tc@box:~$ line=' '
tc@box:~$ [ ! "${line}" == "" ] && echo true || echo false
true
tc@box:~$ [ "$(echo $line)"  ] && echo true || echo false
false
Sometimes *.dep files may contains empty spaces.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: RAM limitation?
« Reply #8 on: June 08, 2018, 08:32:12 AM »
When developing extensions, or if you are using a boot method which doesn't use .dep files, then the following two short scripts can help find missing libraries, or extra extensions. Both of these scripts assume that copy2fs is not used.

find-not-found finds all executables with unresolved references. Remember that plugin dependencies are typically NOT listed in .dep files so this can help find them.
Code: [Select]
#!/bin/sh
#
for a in $(find /tmp/tcloop -type f)
        do file -b $a | grep -q '^ELF ' && TLIB=$(ldd $a | grep found) && [ -n "${TLIB:+x}" ] && echo -e "$a\n$TLIB"
done

find-not-reffed lists extensions which do not have any libraries which are referenced by another extension. Non-executable references are not checked for so utility extensions for example will be listed.
Code: [Select]
#!/bin/sh
#
{ tce-status -i ;
for b in $(for a in $(find /tmp/tcloop -type f)
                do file -b $a | grep -q '^ELF ' && ldd $a | grep /local/ | cut -d\  -f3 | cut -d/ -f5
                done | sort -u)
        do find /tmp/tcloop -name $b | cut -d/ -f4
done | sort -u ; } | sort | uniq -u