Memory fully used sudenly, PC getting very slow.

Archived topics about LMDE 1
Locked
FDF
Level 2
Level 2
Posts: 99
Joined: Fri Nov 04, 2011 7:55 pm

Memory fully used sudenly, PC getting very slow.

Post by FDF »

Hi,

Since few days, without noticeable update (not major, but maybe a small package …) I have a problem.
I think it is coming from skype, but I am not sure.
Here is the problem.
Suddenly the PC become very slow.
When I look at that with top, no processus is very high (10~15% on CPU max), (skype a little higher than usual), but the occupation is about 6 to 8. So clearly it is slow.
But the memory available is almost fully gone… I guess I am using swap an lot at this time (Haven't checked). When I kill skype, the memory available is coming back and the responsiveness of the PC too.

When looking to the log, I would say it is starting here…

Code: Select all

Jun 20 15:41:16 desktop kernel: [86881.964077] INFO: task preload:2457 blocked for more than 120 seconds.
Jun 20 15:41:16 desktop kernel: [86881.964087] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jun 20 15:41:16 desktop kernel: [86881.964094] preload         D ffff8800bc33a7a0     0  2457      1 0x00000000
Jun 20 15:41:16 desktop kernel: [86881.964107]  ffff8800bc33a7a0 0000000000000082 ffff8800be8fbb78 ffff8800ad7df660
Jun 20 15:41:16 desktop kernel: [86881.964121]  0000000000013b40 ffff8800be8fbfd8 ffff8800be8fbfd8 0000000000013b40
Jun 20 15:41:16 desktop kernel: [86881.964132]  ffff8800bc33a7a0 ffff8800be8fa010 ffff8800be8fbb78 ffffffff81066157
Jun 20 15:41:16 desktop kernel: [86881.964142] Call Trace:
Jun 20 15:41:16 desktop kernel: [86881.964160]  [<ffffffff81066157>] ? timekeeping_get_ns+0xe/0x2e
Jun 20 15:41:16 desktop kernel: [86881.964171]  [<ffffffff810b5e43>] ? __lock_page+0x63/0x63
Jun 20 15:41:16 desktop kernel: [86881.964184]  [<ffffffff8133163e>] ? io_schedule+0x84/0xc3
Jun 20 15:41:16 desktop kernel: [86881.964192]  [<ffffffff810b5e4c>] ? sleep_on_page+0x9/0xd
Jun 20 15:41:16 desktop kernel: [86881.964199]  [<ffffffff81331c9d>] ? __wait_on_bit+0x3e/0x6f
Jun 20 15:41:16 desktop kernel: [86881.964208]  [<ffffffff810b5f88>] ? wait_on_page_bit+0x6a/0x70
Jun 20 15:41:16 desktop kernel: [86881.964217]  [<ffffffff8105f38b>] ? autoremove_wake_function+0x2a/0x2a
Jun 20 15:41:16 desktop kernel: [86881.964226]  [<ffffffff810b5ffa>] ? __lock_page_or_retry+0x34/0x38
Jun 20 15:41:16 desktop kernel: [86881.964236]  [<ffffffff810b76cd>] ? filemap_fault+0x1bd/0x34e
Jun 20 15:41:16 desktop kernel: [86881.964244]  [<ffffffff811a752d>] ? put_dec+0x2e/0x33
Jun 20 15:41:16 desktop kernel: [86881.964254]  [<ffffffff810d205d>] ? __do_fault+0x52/0x430
Jun 20 15:41:16 desktop kernel: [86881.964264]  [<ffffffff810fa41e>] ? __dentry_open+0x1a5/0x297
Jun 20 15:41:16 desktop kernel: [86881.964273]  [<ffffffff810d32b3>] ? handle_pte_fault+0x352/0x954
Jun 20 15:41:16 desktop kernel: [86881.964281]  [<ffffffff811a9253>] ? vsnprintf+0x7e/0x428
Jun 20 15:41:16 desktop kernel: [86881.964291]  [<ffffffff81335b78>] ? do_page_fault+0x32a/0x34c
Jun 20 15:41:16 desktop kernel: [86881.964299]  [<ffffffff81126c50>] ? fsnotify_clear_marks_by_inode+0x20/0xbe
Jun 20 15:41:17 desktop kernel: [86881.964309]  [<ffffffff8103acc6>] ? __dequeue_entity+0x1b/0x2f
Jun 20 15:41:17 desktop kernel: [86881.964317]  [<ffffffff81008747>] ? __switch_to+0x276/0x288
Jun 20 15:41:17 desktop kernel: [86881.964325]  [<ffffffff8103b7e0>] ? pick_next_task_fair+0xf9/0x10a
Jun 20 15:41:17 desktop kernel: [86881.964334]  [<ffffffff81066157>] ? timekeeping_get_ns+0xe/0x2e
Jun 20 15:41:17 desktop kernel: [86881.964343]  [<ffffffff81066aec>] ? ktime_get_ts+0x5f/0x85
Jun 20 15:41:17 desktop kernel: [86881.964351]  [<ffffffff81332fd5>] ? page_fault+0x25/0x30

Unfortunatly not very clear to me.

Does anybody can explain or has a possible explanation (and better a possible solution) to this problem?

Thanks and regards

User avatar
WharfRat
Level 21
Level 21
Posts: 13490
Joined: Thu Apr 07, 2011 8:15 pm

Re: Memory fully used sudenly, PC getting very slow.

Post by WharfRat »

FDF,

Sounds like skype might have a memory leak.

Open a terminal and use watch -d free -th

It will show memory and swap usage updated every two seconds. Maybe you can get an idea of what's going on.

Good luck :wink:
ImageImage

FDF
Level 2
Level 2
Posts: 99
Joined: Fri Nov 04, 2011 7:55 pm

Re: Memory fully used sudenly, PC getting very slow.

Post by FDF »

Hi,

I have sent that, but wait and nothing happen.

Let's wait.

Thanks

kurotsugi
Level 6
Level 6
Posts: 1038
Joined: Fri Jan 25, 2013 3:54 am

Re: Memory fully used sudenly, PC getting very slow.

Post by kurotsugi »

how much ram do you have?
I can't understand what the log said but I think these command will clear up some memory space

Code: Select all

sudo sysctl -w vm.drop_caches=3
you can change the value between 1,2,3 depends on how many ram space you want to freed. three gives max result. we can also try to increase swap usage by using 'sudo sysctl -w vm.swappiness=90' the default setting is 60 and the max setting is 100. you can adjust this value based on your hardware setup. high swappiness isn't recommended since it slow down our system. if you have big ram you can safely reduce it to 0.

anyway, you can move further by tweaking your sysctl.conf. here's an example of memory and kernel related tweaks

Code: Select all

kernel.sysrq = 1
kernel.random.read_wakeup_threshold=256
kernel.random.write_wakeup_threshold=512
kernel.sched_latency_ns=20000000
kernel.sched_min_granularity_ns = 10000000
kernel.sched_wakeup_granularity_ns = 15000000
# kernel.sched_shares_ratelimit=256000
# kernel.sched_sched_compat_yield=1
kernel.shmmax=268435456
kernel.shmmni=4096
kernel.shmall=2097152
kernel.msgmni=4096
kernel.msgmax=65536
kernel.randomize_va_space=1
kernel.pid_max = 65536

vm.swappiness=10
vm.dirty_expire_centisecs=1000
vm.dirty_ratio=75
vm.dirty_background_ratio=75
vm.min_free_kbytes=10240
vm.dirty_writeback_centisecs=3000
vm.vfs_cache_pressure=50
for a complete tweak, you might want to look into this one

Code: Select all

kernel.sysrq = 1
kernel.random.read_wakeup_threshold=256
kernel.random.write_wakeup_threshold=512
kernel.sched_latency_ns=20000000
kernel.sched_min_granularity_ns = 10000000
kernel.sched_wakeup_granularity_ns = 15000000
# kernel.sched_shares_ratelimit=256000
# kernel.sched_sched_compat_yield=1
kernel.shmmax=268435456
kernel.shmmni=4096
kernel.shmall=2097152
kernel.msgmni=4096
kernel.msgmax=65536
kernel.randomize_va_space=1
kernel.pid_max = 65536

fs.inotify.max_queued_events=32000
fs.inotify.max_user_instances=256
fs.inotify.max_user_watches=10240

vm.swappiness=10
vm.dirty_expire_centisecs=1000
vm.dirty_ratio=75
vm.dirty_background_ratio=75
vm.min_free_kbytes=10240
vm.dirty_writeback_centisecs=3000
vm.vfs_cache_pressure=50

net.ipv4.ip_local_port_range = 2000 65000
net.ipv4.ip_forward=0

net.ipv4.conf.lo.rp_filter = 1
net.ipv4.conf.lo.accept_redirects = 1
net.ipv4.conf.lo.accept_source_route = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_redirects = 1
net.ipv4.conf.all.accept_source_route=1
net.ipv4.conf.all.secure_redirects=1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route=1
net.ipv4.conf.default.accept_redirects=1
net.ipv4.conf.default.secure_redirects=1
net.ipv4.conf.all.log_martians = 0
net.ipv4.conf.lo.log_martians = 0

net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_probes=5
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_synack_retries=3
net.ipv4.tcp_syn_retries=3
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_congestion_control=cubic
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_ecn = 0
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_dsack=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_fin_timeout=20
net.ipv4.tcp_moderate_rcvbuf=1
net.ipv4.tcp_mem=524288 524288 524288
net.ipv4.tcp_wmem=10240 87380 16777216
net.ipv4.tcp_rmem=10240 87380 16777216
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.icmp_echo_ignore_all=1
net.ipv4.udp_rmem_min=6144
net.ipv4.udp_wmem_min=6144
net.ipv4.ip_dynaddr=0
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.core.rmem_default=16777216
net.core.wmem_default=16777216
net.core.optmem_max=20480
net.core.netdev_max_backlog=5000
net.core.somaxconn = 65000
net.unix.max_dgram_qlen=50

FDF
Level 2
Level 2
Posts: 99
Joined: Fri Nov 04, 2011 7:55 pm

Re: Memory fully used sudenly, PC getting very slow.

Post by FDF »

I have 4 GB ram, and 5 more for swap.

I was not running anything that may need so much ram at this time.
It hasn't happen again (few time last week) and not anymore…

So up to now it will be wait and see.

Best regards

LZux
Level 1
Level 1
Posts: 14
Joined: Sun Sep 09, 2012 6:43 am

Re: Memory fully used sudenly, PC getting very slow.

Post by LZux »

I also noticed my PC becoming sluggish recently (recently from the main LMDE repo, went to Mate 1.6).
I had 4GB RAM & 4GB swap.
What I noticed was swap was being used more, more than 2GB I think. And when swap was being used, the PC was sluggish.

I used "top" and sorted by swap. Also used gkrellm with plugin gkhdplop. These both show the PC happily swapping away.

The main culprit for me was SpiderOak (which I have cron'd to run 'batchmode' every couple of hours).

The PC is old but works very well for us ( It's setup in a multiseat environment so two of us can use it at the same time).
I decided to add another 2GB ram to reduce the swap load, now the sluggish'ness has all but gone.

Locked

Return to “LMDE 1 Archive”