2

A few weeks back, I asked this question here: whats-the-best-action-to-take-when-the-system-freezes

My system is a wonderful Lenovo X220 with i5 2520M, 6Gb Ram & a 960Gb SSD, with Ubuntu 16.04 64bit installation.

My usage is purely development & I keep atleast two browsers open all the time, my preferred FF-Dev Version & either Chrome / Opera. The freezing continues every single day without fail & invariably I give up & restart the system.

I just opened my system monitor & noticed something odd. See this:

enter image description here

What is odd is that the system ram is almost completely used up, however, swap is hardly touched. Why is the system not migrating some files to swap?

Digging deeper, it appears Firefox-Dev is the culprit here. However, I am hesitant to purge it. Are there any recommendations on resolving this memory issue?

P.S: This is with my system on for 5min, I pretty shutdown whenever I am not using it.

UPDATE:

In response to Ravexina's reply, here is a better picture of stats at this moment, this is while I have atom (IDE) not open. The system is functioning fine right now, I guess my alarm is that Firefox is consuming too much.

enter image description here

3
2

Instead of using system monitor, use some utility specially designed to monitor memory usages; Things like free or vmstat.

If you run a command like free -h, you'll get an output similar to:

             total     used     free      shared  buff/cache  available
Mem:         6G        1G       5G        65M     3G          4G
Swap:        4G        0B       4G

As you said:

What is odd is that the system ram is almost completely used up.

It's actually not true, a lot of your memory is being used for buffering and caching stuff, that means they are available for use in case of any need. Linux just uses them to efficiently use all available memory. Pay attention to the “available” column.

The “used” column is the actual amount of memory is being used by your programs.

And about the swap, it will only be used when you are out of memory, say your “used” columns is almost close to your “total” or in any other similar situation. E. g. I've got 8G of swap and it's almost always not being used.

When your cache is being used heavily, it's a sign that something is wrong with memory; Maybe we don't have enough memory etc. And it will slow down the system cause you are using a part of your hard drive instead of a RAM memory which is pretty slow in comparison of a RAM.

So I don't think your problem is related to swap NOT being used, it might be swap being used because you are out of memory.

Check how much free memory you actually have and what processes are using it, that might be helpful to solve your problem.

I guess it's enough to guide your question. ;)

2
  • thank you, I have updated my question with your suggested measurements. – Kayote May 7 '17 at 9:26
  • It seems that something is heavily using your memory and your swap is being used too, 500 MB is not a small amount for swap. To diagnose that ask another question related to high memory usages and post the free -h output along with that. cause it's really behind the scope of this one. – Ravexina May 7 '17 at 9:40
1

Can you provide some more info on: number of tabs usually loaded while Browser is up, only ff-dev or ff-dev + Chrome + Opera @same time working with 10-tabs each maybe, do you use hibernation as a power-option etc. lot's of stuff comes to my mind but you need to provide much concise info so we can help you out, after all you are a developer, so I bet you are lazy as myself but sometimes you need to troubleshoot your machine in order to fix it. Go get some more information and post it here. Ubuntu 16.02 or Ubuntu 16.04.2? What environment are you using, log startup programs and services with blame etc, do some troubleshooting and post us logs and more concise info on your system.

On top of all your Swap partition is too small for your Ram proportions I think. With that SSD you can get much better performance.

I also do the dev-stuff on my laptop but it never goes above 5% processor cores or 2-3GB Ram of 8gb, one module burned recently but works fine with 8gb as well and without SSD in 2nd slot, only HDD on 7200 RPM inside machine and after RAM and SSD burned after electric shock I made SWAP partition for the first time(did not have it at all with 16gb Ram because it never goes above 5gb in my case). I guess you should check out all scenarios & variables and help us help you to solve the problem, myb provide what services/packages you are running often or on system start. I disabled apache2, mongod and MySql servers from starting automaticaly so I pop them On when needed, also NodeJS and much more stuff that can rape that i5 in your rig.

What IDEs are you on, what kind of dev-stuff you do if that's not a secret? Describe standard scenario/situation like you said "this happens after 5min. system start time" what you usually do first 5mins. or just provide startup programs/services with sudo systemd-analyse blame Lot's of stuff can do the mess-job there, just need some more information from you to troubleshoot it faster my friend.

Here is my situation with all 4 servers running for 10-15-30min. now and using phpmyadmin for MySql actively also Robomongo - MongoDB Gui with Apache Server and Postgre-9.5, Browsing in Chromium 9-10 tabs and Firefox on, so with almost 300 processes and 10+ panels in top of it and barely 3GB Ram used(that's my high-usage btw.), processor barely above 2% usage as you see.

Here is a screenshot of my current system state, send me feedback if you like or check it out and compare to your usual usage level

http://i.imgur.com/64d7anu.png

Will check back topic later and try to help you troubleshoot this when you provide more info, I am really interested what bothers you that much.

UPDATE

Well that depends on the cloning tools and what type of cloning you did. But let's say you saved your data you don't wanna lose, time for new Partition Table on your SSD, give that machine some breathe bro :) it's choking for no reason. And yes Firefox-dev is a bad optimized browser resources-wise and it just snatches enormous amount of RAM pretty fast, I did use it on my old rig and after a while realized I don't really gain that much out of it, comparing to lighter Chromium + FFox(normal edition) just covers every aspect of web-development testing and with few plugins you even gain much more with less resources eaten by dev-edition. You need to fing a perfect combination of Linux Distro + Desktop Environment for your needs and of course respect the rig requirements and according to that just make your perfect IDE with no headaches like this and morning smile while drinking 1st coffee and being satisfied you can work freely and not be scared of data-loss or hardware failure+data-loss(god forbid) :)

Let me know if you need any help on building your own rig for your own needs and development variation.

cheers

3
  • Thank you Miki, you have certainly given me thoughts for concern :). Im going to do another post & elaborate on the setup. I should mention that inspite of the recommendation that do not port over your HD to SSD, I really wanted to keep data as it, hence i cloned my old 5200rpm hd to ssd. Might that be a partial cause or not, not sure. – Kayote May 7 '17 at 13:26
  • Thank you, appreciate the time vested in these answers. IM seriously thinking about my Swap file size & maybe checkout Firefox normal version going forward. I hope to raise a new question tomorrow with details & specifics so hopefully we can resolve this. – Kayote May 7 '17 at 17:34
  • I'm certain we will resolve it bro, just don't be afraid and ask here, community is here to help - backup your stuff, reinstall new clean system with normal partition table with swap+boot+root+home partitions separated so next time you have all your stuff safe on home partition and freely reinstall linux every-day if you like to test best combination. – Miki May 7 '17 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.