Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

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

  1. #1
    Join Date
    Feb 2015
    Beans
    43

    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,187

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

    install zram-config & reboot

    it makes swap in ram

  3. #3
    Join Date
    Feb 2015
    Beans
    43

    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
    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

  5. #5
    Join Date
    Feb 2015
    Beans
    43

    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.

  6. #6
    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


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

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

    18 tabs opened at once
    i think you does not needs more explanations
    Look at the chromium settings, and try to find settings you can turn off, and/or add like adblock

  8. #8
    Join Date
    Feb 2015
    Beans
    43

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

    Guys, I would REALLY like to thank you all for the suggestions, but that's not what I've been asking for.

    I think we all agree that 4GB should be enough, and I should not be swapping ALL THE TIME. I'm not streaming videos or audio, I am just reading forums, documentations, reference guides of MPI, FORTRAN, dicionaries - plain text almost always, some few images. I do have adblock in draconian mode on. There is no justification for 4GB of memory being used constantly. My old laptop had 4GB memory and no TMPFS, and I've never had a problem with it. It did not have zram or anything like that. It was just a plain installation of Gentoo Linux.

    I cannot comprehend how Ubuntu allows all of my memory to be consumed in such a mysterious way. "Change your habits" is not an answer. I can sum up 35% of memory use, with all the applications open, where are the other 65% being spent?!?! Its not about my habits, it is the system managing my resources in a way that doesn't fit my needs. I would guess that this is TMPFS's fault, if Ubuntu has TMPFS enabled by default (for those who don't know what TMPFS is, please Google it quickly, its quite simple, really). Can anyone comment on how to see if it is enabled and how to disable it in Ubuntu? If not, can someone suggest me a way to ***find out who is eating those 65% of my memory resources***?

  9. #9
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    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.

  10. #10
    Join Date
    Feb 2015
    Beans
    43

    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?

Page 1 of 4 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
  •