36

I have 4GB RAM. When I open Firefox, IntelliJ IDEA or VS Code and some other application my memory is about used up thus my machine hangs and I can't do anything. I can't even close any applications.

Date and time are shown in the top bar so that I can view it any time without any thing typing.

If I would view memory status in this way without typing anything then I can make a decision whether to open an application or whether this application may put my machine in hanging state or not.

Is it possible in Ubuntu 18.04 LTS?

pomsky
  • 68,507
alhelal
  • 2,621

6 Answers6

30

You may try a GNOME shell extension called "system-monitor". It does

Display system informations in gnome shell status bar, such as memory usage, cpu usage, network rates…

enter image description here

"system-monitor" depends on a few packages. To install them, run

sudo apt install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0 gir1.2-clutter-1.0

Then log out and log in again.

pomsky
  • 68,507
  • 2
    I run this command and log out and log in but nothing is shown. – alhelal Jul 18 '18 at 09:07
  • @alhelal That command itself won't do anything, it'll just install dependencies for the "sysrtem-monitor" extension. You'll have to install the extension too. See the top half of the answer. – pomsky Jul 18 '18 at 09:17
  • 1
    I am in doubt whether it is a web extension or desktop app. Your addressed answer give only browser solution. If it is web app why I need browser setting to install. – alhelal Jul 18 '18 at 09:23
  • @alhelal It's neither a web extension nor a desktop app. It's an extension for GNOME shell. – pomsky Jul 18 '18 at 09:24
  • Then why I have to change firefox setting? I want to download and install. How can I do? – alhelal Jul 18 '18 at 09:30
  • 1
    @alhelal Then open "(GNOME) Software" (the software store application) and search for "system-monitor". – pomsky Jul 18 '18 at 09:33
  • 2
    @RingØ No, you're confusing two different things. gnome-system-monitor rather confusingly is the GUI application called "System Monitor" which is usually pre-installed and can be found in "Show Applications". This one is a GNOME shell extension called "system-monitor", see its homepage. To verify this, run the command gnome-system-monitor in Terminal, the GUI app "System Monitor" will launch. This extension also lets you launch the GUI app "System Monitor" (the button above "preferences" in the screenshot). – pomsky Aug 22 '18 at 18:39
  • @pomsky Yeah, was checking the source to change a few things and indeed, it's actually some JS in ~/.local and not GSM – Déjà vu Aug 22 '18 at 18:47
  • It is highly suspicious that https://extensions.gnome.org/extension/120/system-monitor/ is using the same name and icon as the built-in gnome-system-monitor. – D. Ror. Oct 24 '18 at 22:44
  • 1
    @D.Ror. There's nothing suspicious per se. First "system monitor" is a simple, descriptive, and easily understood term. Secondly gnome-system-monitor doesn't have a specific icon of its own, it just uses the generic utilities-system-monitor icon provided by the icon set (the same icon is used by other similar apps, e.g. lxtask, xfce4-taskmanager etc.). – pomsky Oct 25 '18 at 06:18
  • @pomsky No such logo is on the entrence to the lxtask webpage, and xfce4-taskmanager uses a similar logo, but clearly different. (gnome-)system-monitor has both the same name AND same logo, which (if not intentionally misleading) is confusing. – D. Ror. Oct 26 '18 at 13:37
  • @D.Ror.Please install those apps and check the Icon= line in their .desktop launcher and verify. – pomsky Oct 26 '18 at 13:55
  • I ran the command on Ubuntu 22.04, and it returns E: Unable to locate package gir1.2-networkmanager-1.0 E: Couldn't find any package by glob 'gir1.2-networkmanager-1.0' – Kevin Patel May 09 '23 at 09:27
22

As pointed out in the other post you want to install the Gnome Shell Extension system-monitor There's a browser plugin and integrations that can allow you to install it from the browser or from the software center as mentioned by @pomsky.

However I've found that the easiest way to install it is to just install it from apt using the debian package

sudo apt-get install gnome-shell-extension-system-monitor

This will also pull in all the required dependencies, and after a reboot or log out the system monitor was in the top task bar.

enter image description here

(Note that I think I enabled the swap manually before taking the screenshot.)

Tully
  • 1,811
  • 1
    I see nothing added after a reboot. I've taken the apt install approach suggested here, on Ubutnu 18.04 and am using its default gnome version. What do you consider to be the top task bar? – matanox Nov 30 '19 at 12:17
  • 1
    please note that for this solution the user should use the default gnome shell and they also should restart their machine (not just lock-unclock). – john gonidelis Mar 10 '20 at 14:15
  • I believe that you should only need to restart your gnome session for which logging out is adequate. Locking the screen is not logging out. You get a very similar login prompt, but as you noticed it doesn't restart your session so you don't get the new settings. – Tully Mar 11 '20 at 16:59
13

Based on my experience, there are 2 packages required:

  1. gnome-shell-extension-system-monitor
  2. gnome-tweaks

Luckily, these 2 can be installed easily with the following command:

sudo apt install gnome-tweaks gnome-shell-extension-system-monitor

Open Tweaks, navigate to the Extensions tab, ensure that extensions in general are enabled, and then find "System-monitor" in the list on the same tab, and enable it.

enter image description here

That's it, problem solved. No reboot required in my case. This is also tested on Ubuntu 20.04

However, if the system-monitor does not appear in Tweaks > Extensions, reboot the laptop and it should be there after that.

6

In Ubuntu 18.04 (assuming you're using the default gnome desktop at least) run the gnome Tweaks app. Everything you need to manage for that is there, including what exactly you'd like to see from gnome system-monitor on the dock bar, which you can configure through the settings icon near the on/off switch for system-monitor seen below.

enter image description here

Unfortunately the extension doesn't really fit the dock's default color so it might be a little ugly when you configure to see graphs and not digit values there. So I ended up configuring to show the digit value only for now.

matanox
  • 2,293
0

TLDR

  1. sudo apt-get install gnome-shell-extension-system-monitor
  2. gnome-extensions enable system-monitor@paradoxxx.zero.gmail.com
  3. Sort of restart, but as Tully says, only gnome shell needs to.

I've just refined this on my third Ubuntu 20.04, and did it on 18.04 way back in 2018/2019.

sudo apt-get update
sudo apt-get install gnome-shell-extension-system-monitor

I tried logging out and in and even rebooted all to no effect.

What worked was (instead of gnome-tweaks, which sounds Kev-ish):

gnome-extensions enable system-monitor@paradoxxx.zero.gmail.com

I discovered this from the author's README (where they are calling the tool an "applet"):

Enable it with gnome-tweak-tool or gnome-shell-extension-tool --enable-extension=system-monitor@paradoxxx.zero.gmail.com

and playing with that command (because writing someone else's email sounds like an exfiltration risk).

On previous attempts I had already restarted and could just issue some CLI voodoo (actually the enable step from the TLDR, though substituting info indicated enable would be needed) to have the graphs magically appear:

My top bar after enable

You won't see this yet if you don't sort of restart. What I did was open a text only terminal with Ctrl-Alt-F3 and requested it to restart display-manager. After some glitches where my password entries looped back to me via a black screen a couple of times I was in.

Was all my stuff still running? Probably not! But I had saved or shut it down.

John
  • 141
0

In Ubuntu 21.04 you have to install Google Chrome and the chrome extension for Gnome Shell extensions to install the system monitor extension.

You can go to https://extensions.gnome.org/ and then install the chrome plugin and then view any of the gnome extensions in chrome and then enable or disable the extension from the browser itself.

anoopjohn
  • 211
  • 3
  • 11