Page 1 of 3 123 LastLast
Results 1 to 10 of 31

Thread: Why can't I stop swapping?!?!

Hybrid View

  1. #1
    Join Date
    Feb 2015
    Beans
    38

    Why can't I stop swapping?!?!

    I'm in a slow machine with only 4GB memory, and I am clearly swapping all the time. htop reveals that the task eating the most memory is the webbrowser (chromium), with 12~18% of the memory, with the second place going to something with 3 or 4% memory usage. Am I mistaken or Ubuntu 14.04 LTS has tmpfs enabled by default? If so, I'd assume that the memory is being shared with TMPFS, which would then easily fill 50% of the memory in one strike (just the cache of the browser could eat that fairly quickly).

    Code:
    sacrispada@localhost ~ cat /etc/mtab/dev/sda6 / ext4 rw,errors=remount-ro 0 0
    proc /proc proc rw,noexec,nosuid,nodev 0 0
    sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
    none /sys/fs/cgroup tmpfs rw 0 0
    none /sys/fs/fuse/connections fusectl rw 0 0
    none /sys/kernel/debug debugfs rw 0 0
    none /sys/kernel/security securityfs rw 0 0
    udev /dev devtmpfs rw,mode=0755 0 0
    devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
    tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
    none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
    none /run/shm tmpfs rw,nosuid,nodev 0 0
    none /run/user tmpfs rw,noexec,nosuid,nodev,size=104857600,mode=0755 0 0
    none /sys/fs/pstore pstore rw 0 0
    systemd /sys/fs/cgroup/systemd cgroup rw,noexec,nosuid,nodev,none,name=systemd 0 0
    mtab seems to suggest that only 10% of my memory is reserved for that purpose, but it doesn't "feel" like so! Maybe I could disable TMPFS overall, to see if it changes? services --status-all doesn't seem to show anything tmpfs-related, but then again I'm not really a specialist in non-OpenRC builds.
    Code:
     [ + ]  acpid
     [ - ]  anacron
     [ - ]  apparmor
     [ ? ]  apport
     [ + ]  avahi-daemon
     [ + ]  bluetooth
     [ - ]  brltty
     [ ? ]  console-setup
     [ + ]  cron
     [ ? ]  cryptdisks
     [ ? ]  cryptdisks-early
     [ + ]  cups
     [ + ]  cups-browsed
     [ - ]  dbus
     [ ? ]  dns-clean
     [ + ]  friendly-recovery
     [ - ]  grub-common
     [ ? ]  irqbalance
     [ + ]  kerneloops
     [ ? ]  killprocs
     [ ? ]  kmod
     [ ? ]  lightdm
     [ ? ]  networking
     [ + ]  ntp
     [ ? ]  ondemand
     [ ? ]  openafs-client
     [ ? ]  pppd-dns
     [ - ]  procps
     [ - ]  pulseaudio
     [ ? ]  rc.local
     [ + ]  resolvconf
     [ - ]  rsync
     [ + ]  rsyslog
     [ + ]  saned
     [ ? ]  sendsigs
     [ ? ]  speech-dispatcher
     [ - ]  sudo
     [ - ]  udev
     [ ? ]  umountfs
     [ ? ]  umountnfs.sh
     [ ? ]  umountroot
     [ - ]  unattended-upgrades
     [ - ]  urandom
     [ - ]  x11-common
    Any suggestion?

  2. #2
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,189

    Re: Why can't I stop swapping?!?!

    install zram-config & reboot

    it makes swap in ram

  3. #3
    Join Date
    Feb 2015
    Beans
    38

    Re: Why can't I stop swapping?!?!

    I guess I didn't explain myself properly. I have little RAM, so I want to use less RAM, not more.
    I'd like to disable TMPFS exactly for that purpose, to have less RAM usage.

  4. #4
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,189

    Re: Why can't I stop swapping?!?!

    Quote Originally Posted by kerry_s View Post
    install zram-config & reboot

    it makes swap in ram
    my bag, i was on my ipod & cooking at the time, so i kind of just stopped mid sentence.
    anyways read the link " grahammechanical " provided, it will help make better use of your ram.

    i use it on my netbook which only has 2gb, mine hasn't used actual swap yet since install.
    chromium/chrome has had memory issues for some time now, there are bug reports on the issue you can google.
    i myself have started using firefox more for when i need to use a lot of tabs or for media consumption, youtube addict.

  5. #5
    Join Date
    Feb 2015
    Beans
    38

    Re: Why can't I stop swapping?!?!

    Quote Originally Posted by kerry_s View Post
    my bag, i was on my ipod & cooking at the time, so i kind of just stopped mid sentence.
    anyways read the link " grahammechanical " provided, it will help make better use of your ram.

    i use it on my netbook which only has 2gb, mine hasn't used actual swap yet since install.
    chromium/chrome has had memory issues for some time now, there are bug reports on the issue you can google.
    i myself have started using firefox more for when i need to use a lot of tabs or for media consumption, youtube addict.
    Is zram going to help me figure out where the other 65% of my memory resources are being spent?

  6. #6
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,189

    Re: Why can't I stop swapping?!?!

    Quote Originally Posted by holysword View Post
    Is zram going to help me figure out where the other 65% of my memory resources are being spent?
    it's more than likely cache, if nothing needs the ram & you have lots of ram available it will use it. did the same thing when i had a 4gb ram laptop, it's nothing to be worry about it's a os speed trick to make apps feel faster.

    unless your getting the gray dim screen, which it does when busy, just go on about your business & let the os do it's job allocating available resources.

    what are you going to do with unused ram anyways ? such a waste just sitting there all empty.

  7. #7
    Join Date
    Jul 2014
    Beans
    1,289
    Distro
    Ubuntu Mate

    Re: Why can't I stop swapping?!?!

    Could we see the output of:
    Code:
    free -m

  8. #8
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Why can't I stop swapping?!?!

    yes 4 gb is enough and swapping should be only random and little.
    maybe you open many tabs with chromium, which can be a reason. But you should also glance at the 'swappiness' settings, maybe you need to adjust them
    http://askubuntu.com/questions/10391...ure-swappiness

  9. #9
    Join Date
    Feb 2015
    Beans
    38

    Re: Why can't I stop swapping?!?!

    I have no much choice concerning the amount of tabs I keep open... I basically have to keep several open. 18 right now. Hard to explain, but it is part of my work.
    My complaint is not that the swap is being used, is that my memory is being OVERUSED. Chromium is taking 20% of the memory, but the remaining 80% could not possible be consumed by other processes which are taking pretty much nothing. If 60% of my memory would be in use I'd understand, but its ALWAYS at least 90%. This smells to me like tmpfs work. Swappiness or not swappiness, I would run out of memory anyway.

  10. #10
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Why can't I stop swapping?!?!

    I agree about Chromium being a memory hog and some websites use more memory than others. I have also noticed that in Ubuntu total memory also includes memory set aside in cache. As more applications are opened cache memory gets smaller. An OS will claim as much memory as is available. After all, that is what the memory is there for.

    Oh, by the way, zram does not convert swap into memory. It uses a form of memory compression to avoid swapping to disk. Although, as has already been stated, with 4GB RAM you should not need to swap.

    http://en.wikipedia.org/wiki/Zram

    Regards.
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •