Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #264320

Re: Isolated Web Co Session crash Firefox-ESR

From Karl Vogel <vogelke@pobox.com>
Newsgroups linux.debian.user
Subject Re: Isolated Web Co Session crash Firefox-ESR
Date 2023-12-06 10:20 +0100
Message-ID <HHWet-bEpH-7@gated-at.bofh.it> (permalink)
References (1 earlier) <HGNPX-aJkB-11@gated-at.bofh.it> <HGOiZ-aJtY-1@gated-at.bofh.it> <HH6SB-aURe-1@gated-at.bofh.it> <HHIEx-bsNW-1@gated-at.bofh.it> <HHSky-bBbq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Dec 06, 2023 at 06:04:36AM +0100, tomas@tuxteam.de wrote:
> On Wed, Dec 06, 2023 at 02:42:32AM +0800, jeremy ardley wrote:
> 
> > I have discovered a magic bullet for solving running out of memory
> >   sudo sync; sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
> > Sadly it looks like I'll need to do this daily,
> 
> It's the browsers eating your memory. That's what they do.

  I've had problems with Firefox eating my swap on both Linux and FreeBSD.
  My fix has been to run the swap2ram script below hourly.

-- 
Karl Vogel                      I don't speak for anyone but myself

Constipational carry.
  --NY Post 28 Nov "Suspect found hiding handgun in his rectum" comment #4

# ----------------------------------------------------------------------
#!/bin/ksh
#<swap2ram: get swap manually back into RAM.
#           Send results to stdout unless running from cron.

export PATH=/bin:/usr/bin:/sbin
export LC_ALL=C
tag=${0##*/}

# I set the environment variable "CRON" to yes in all crontabs.
case "$CRON" in
    yes)
        logmsg ()  { logger -t "$tag" "$@" ; }
        logfile () { fn="$1"; logger -t $tag -f "$fn" ; }
        ;;

    *)
        logmsg ()  { echo "$(date '+%F %T') $tag: $@"; }
        logfile () { fn="$1"; cat "$fn" ; }
        ;;
esac

die () { logmsg "FATAL: $@"; exit 1; }

# Do we need root to run this?
needroot () {
    case "$1" in
        "") action='do' ;;
        *)  action="$1" ;;
    esac

    id | grep 'uid=0(root)' > /dev/null
    case "$?" in
        0) ;;
        *) die "You must be root to $action this." ;;
    esac
}

# Make sure we have permission and a safe tempfile.
needroot
systype=$(uname -s | tr A-Z a-z)

tmp=$(mktemp -q "/tmp/$tag.XXXXXX")
case "$?" in
    0)  test -f "$tmp" || die "$tmp: tempfile not created" ;;
    *)  die "$tmp: mktemp failed" ;;
esac

# Real work starts here.  Check for OS-specific instructions.
case "$systype" in
    freebsd)
        ( swapoff -a && swapon -a ) >> $tmp 2>&1
        ;;

    linux)
        mem=$(free  | awk '/Mem:/ {print $4}')
        swap=$(free | awk '/Swap:/ {print $3}')

        if test "$mem" -lt "$swap"; then
            logmsg "not enough RAM to recover swap, nothing done"
        else
            ( swapoff -a && swapon -a ) >> $tmp 2>&1
        fi
        ;;
esac

# Cleanup.
test -s "$tmp" && logfile $tmp
rm $tmp
exit 0

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-03 06:00 +0100
  Re: Isolated Web Co Session crash Firefox-ESR Tom Furie <tom@furie.org.uk> - 2023-12-03 06:40 +0100
  Re: Isolated Web Co Session crash Firefox-ESR Phil Wyett <philip.wyett@kathenas.org> - 2023-12-03 07:10 +0100
    Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-03 07:40 +0100
      Re: Isolated Web Co Session crash Firefox-ESR Phil Wyett <philip.wyett@kathenas.org> - 2023-12-03 07:50 +0100
        Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-03 08:10 +0100
          Re: Isolated Web Co Session crash Firefox-ESR Tom Furie <tom@furie.org.uk> - 2023-12-03 08:30 +0100
          Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-03 09:10 +0100
            Re: Isolated Web Co Session crash Firefox-ESR Phil Wyett <philip.wyett@kathenas.org> - 2023-12-03 10:40 +0100
            Re: Isolated Web Co Session crash Firefox-ESR Tom Dial <tddial@comcast.net> - 2023-12-04 02:50 +0100
      Re: Isolated Web Co Session crash Firefox-ESR Jeffrey Walton <noloader@gmail.com> - 2023-12-03 12:50 +0100
      Re: Isolated Web Co Session crash Firefox-ESR Michael Kjörling <2695bd53d63c@ewoof.net> - 2023-12-03 23:10 +0100
        Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-03 23:20 +0100
      Re: Isolated Web Co Session crash Firefox-ESR Max Nikulin <manikulin@gmail.com> - 2023-12-04 03:30 +0100
        Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-04 03:50 +0100
          Re: Isolated Web Co Session crash Firefox-ESR Max Nikulin <manikulin@gmail.com> - 2023-12-04 04:00 +0100
            Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-04 22:40 +0100
        Re: Isolated Web Co Session crash Firefox-ESR jeremy ardley <jeremy.ardley@gmail.com> - 2023-12-05 19:50 +0100
          Re: Isolated Web Co Session crash Firefox-ESR <tomas@tuxteam.de> - 2023-12-06 06:10 +0100
            Re: Isolated Web Co Session crash Firefox-ESR Karl Vogel <vogelke@pobox.com> - 2023-12-06 10:20 +0100
              Re: Isolated Web Co Session crash Firefox-ESR debian-user@howorth.org.uk - 2023-12-06 13:00 +0100
            Re: Isolated Web Co Session crash Firefox-ESR Max Nikulin <manikulin@gmail.com> - 2023-12-06 15:30 +0100
              Re: Isolated Web Co Session crash Firefox-ESR <tomas@tuxteam.de> - 2023-12-06 16:00 +0100
          Re: Isolated Web Co Session crash Firefox-ESR Max Nikulin <manikulin@gmail.com> - 2023-12-06 15:50 +0100
  Re: Isolated Web Co Session crash Firefox-ESR David Christensen <dpchrist@holgerdanske.com> - 2023-12-03 08:50 +0100
  Re: Isolated Web Co Session crash Firefox-ESR Reco <recoverym4n@enotuniq.net> - 2023-12-03 14:00 +0100

csiph-web