You are not logged in.

#1 2015-04-02 18:30:27

dejy
Member
Registered: 2014-03-18
Posts: 67

What's going on with my Swap-use?

I've been running into a problem when streaming videos on Firefox, where my memory usage suddenly spikes to near max, my swap-space is filled and xserver locks up. After restarting xserver the swap-space is still filled. Running a script:

[dejy@a-pc sh]$ ./swap_use.sh
PID=1 swapped 392 KB (systemd)
PID=137 swapped 140 KB (systemd-journal)
PID=179 swapped 548 KB (systemd-udevd)
PID=371 swapped 188 KB (dbus-daemon)
PID=372 swapped 464 KB (crond)
PID=373 swapped 916 KB (ModemManager)
PID=379 swapped 576 KB (login)
PID=383 swapped 4276 KB (polkitd)
PID=467 swapped 324 KB (systemd)
PID=469 swapped 1332 KB ((sd-pam))
PID=471 swapped 332 KB (bash)
PID=1580 swapped 920 KB (NetworkManager)
PID=1591 swapped 144 KB (wpa_supplicant)
PID=4792 swapped 80 KB (systemd-logind)
PID=8222 swapped 1136 KB (pulseaudio)
PID=8223 swapped 188 KB (rtkit-daemon)
PID=8229 swapped 820 KB (gconf-helper)
PID=21983 swapped 40136 KB (soffice.bin)
PID=22965 swapped 632 KB (upowerd)
Overall swap used: 53544 KB
free -h
              total        used        free      shared  buff/cache   available
Mem:           3.7G        673M        2.3G        268M        728M        2.5G
Swap:          1.0G        952M         71M

What do I want to look at to figure out what's eating all the swap space?

Last edited by dejy (2015-04-02 18:31:13)

Offline

#2 2015-04-03 11:08:23

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 507

Re: What's going on with my Swap-use?

Are you streaming flash or UPNP? Have you made any adjustments to flash (right click on flash for menu)?


An old man, trying to stay sane

Offline

#3 2015-04-03 11:22:47

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: What's going on with my Swap-use?

What kind of memory usage do you observe? buffer/cache or direct application usage.
Do you have your firefox cache put on a ramdisk?

Is it only happening with specific kinds of videos?


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#4 2015-04-03 14:01:06

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: What's going on with my Swap-use?

What's the output of "df -h" and 'cat /proc/meminfo"?

Offline

#5 2015-04-03 17:09:44

dejy
Member
Registered: 2014-03-18
Posts: 67

Re: What's going on with my Swap-use?

Buddlespit wrote:

Are you streaming flash or UPNP? Have you made any adjustments to flash (right click on flash for menu)?

Yes I'm streaming a flash video -  but I'm not at the stage of diagnosing the Firefox problem yet, first I'm trying to figure out why after killing firefox and restarting xserver I still have 950mb of used swap space.

lucke wrote:

What's the output of "df -h" and 'cat /proc/meminfo"?

cat /proc/meminfo

MemTotal:        3866340 kB
MemFree:         1732472 kB
MemAvailable:    2136932 kB
Buffers:           27804 kB
Cached:           657780 kB
SwapCached:         1444 kB
Active:           919904 kB
Inactive:         765188 kB
Active(anon):     718856 kB
Inactive(anon):   616704 kB
Active(file):     201048 kB
Inactive(file):   148484 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       1048572 kB
SwapFree:          72476 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        998112 kB
Mapped:           227328 kB
Shmem:            336052 kB
Slab:             355428 kB
SReclaimable:     308332 kB
SUnreclaim:        47096 kB
KernelStack:        6368 kB
PageTables:        23196 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2981740 kB
Committed_AS:    4494596 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      361528 kB
VmallocChunk:   34359372800 kB
HardwareCorrupted:     0 kB
AnonHugePages:    194560 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      179508 kB
DirectMap2M:     3829760 kB

df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda6        33G   31G  684M  98% /
dev             1.9G     0  1.9G   0% /dev
run             1.9G  852K  1.9G   1% /run
tmpfs           1.9G   12M  1.9G   1% /dev/shm
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda7       293M   25M  268M   9% /boot
tmpfs           1.9G  1.1G  844M  56% /tmp
/dev/sda8        16G  9.3G  5.2G  65% /media/data
tmpfs           378M   12K  378M   1% /run/user/1000
/dev/sda4        51G   47G  1.5G  97% /media/blockchain

Offline

#6 2015-04-03 18:47:13

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: What's going on with my Swap-use?

Looks like it's stuff in /tmp swapped out.

Offline

#7 2015-04-03 20:00:21

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 507

Re: What's going on with my Swap-use?

dejy wrote:
Buddlespit wrote:

Are you streaming flash or UPNP? Have you made any adjustments to flash (right click on flash for menu)?

Yes I'm streaming a flash video -  but I'm not at the stage of diagnosing the Firefox problem yet, first I'm trying to figure out why after killing firefox and restarting xserver I still have 950mb of used swap space.

Why wouldn't you? Are you assuming that swap writes to disk when you restart X?

OK, the reason why I asked about your flash player is because if you set it to cache a lot, then it writes somewhere in /tmp, which is really ram. If that fills up, then your system starts to write to swap. Since it can't flush to disk, both your RAM and swap fill up and your system starts acting silly or slow.


An old man, trying to stay sane

Offline

#8 2015-04-04 04:24:27

dejy
Member
Registered: 2014-03-18
Posts: 67

Re: What's going on with my Swap-use?

Buddlespit wrote:
dejy wrote:
Buddlespit wrote:

Are you streaming flash or UPNP? Have you made any adjustments to flash (right click on flash for menu)?

Yes I'm streaming a flash video -  but I'm not at the stage of diagnosing the Firefox problem yet, first I'm trying to figure out why after killing firefox and restarting xserver I still have 950mb of used swap space.

Why wouldn't you? Are you assuming that swap writes to disk when you restart X?

OK, the reason why I asked about your flash player is because if you set it to cache a lot, then it writes somewhere in /tmp, which is really ram. If that fills up, then your system starts to write to swap. Since it can't flush to disk, both your RAM and swap fill up and your system starts acting silly or slow.

Okay so it probably is the flash-video buffer - if it's jumping up to two gigs it might be a leak - but that aside, shouldn't killing firefox free the swap space? Why is my swap still filled up after firefox is killed and xserver has restarted?

Last edited by dejy (2015-04-04 04:25:02)

Offline

#9 2015-04-04 09:27:57

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: What's going on with my Swap-use?

See what's in /tmp with ncdu.

Offline

#10 2015-04-04 13:29:56

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: What's going on with my Swap-use?

tmpfs is handled similar to file cache in ram. So the swapped out content more or less stays there until the space is needed for something else or it gets loaded back to ram.


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

Board footer

Powered by FluxBB