Google Chrome

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Google Chrome

Post by Menard »

Hello

The last version, as frequently new versions, is using rapidly my whole RAM (8 GiB) and then crashes the PC

Solution : not perfect of course
Start the system monitor tool, then process tab, and tab called "chrome --type=renderer..." or else, anyway the ones that take a lot of RAM memory as more than 100 MiB and end it
Last edited by LockBot on Tue Jun 06, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

check out this automated solution to kill processes that exceed memory limit. https://es.stackoverflow.com/questions/ ... 564#557564

The solution is made by me, so comment what you think.
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

Ok, thanks, it is a good idea, I noticed that killing such process, fixes some problems like this, automation would be a great improvement
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
User avatar
nooblinx
Level 2
Level 2
Posts: 67
Joined: Sat Jul 03, 2021 4:13 am

Re: Google Chrome

Post by nooblinx »

use chromium instead. they are same but chromium do not eat RAM!
still noob in linux :~$ echo "my english is not good"
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

No it is not the same, my policy is to avoid to install all browsers that could be not seriously supported by their team, it is generally the problem with too little market share

Chromium browser, it even doesn't exist, type "Chromium browser" in Google or else ...
Last edited by Menard on Wed Jan 04, 2023 8:06 am, edited 1 time in total.
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

-
Last edited by Menard on Thu Jan 05, 2023 6:00 am, edited 1 time in total.
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Google Chrome

Post by Hoser Rob »

Menard wrote: Tue Jan 03, 2023 4:55 am No it is not the same ...
That's right, it isn't the same. Actually I think it's updated as well as Chrome is, it's made by the same people, but Chrome has much better support for some media formats you find on the Web. Better than probably anyone else.

I've also given up 'alternative' browsers, they're always based on one of the big ones anyway but they're not implemented as well. And they don't get security updates as fast as the biggies either.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

I personnaly use 4 browsers : Chrome, Firefox, Opera and Brave, that are for me complementary, and also allow me to have different usages, for example Chrome is the only one where I am logged in my google account, and only when I need it, so I limit me to some common websites on it
The side effect is that it is cool with a separate home partition but I avoid to upgrade Linux when creating a new home is needed (as some say for the upgrade from 20 to 21) so I stay with 20.3 for the moment because my 4 browsers
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

Juan_David95 wrote: Thu Dec 08, 2022 9:17 pm check out this automated solution to kill processes that exceed memory limit. https://es.stackoverflow.com/questions/ ... 564#557564

The solution is made by me, so comment what you think.
I don't really understand

We must use the first script AND the second which is to specify which application and the limit (?) so then you specified Chrome but how for Firefox ?
I have also a problem to have scripts to work, the only one I have is in /home/user/ and without .sh I start it with the terminal by $ ./scrip
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

Menard wrote: Thu Jan 05, 2023 6:00 am I don't really understand

It's simple. The one that says first script is the one that does everything:

1) you create a text file with this name kill_mem.sh (so you don't get tangled). On this route /home/youruser/bin/. if the bin folder does not exist, create it

2) paste in this in the file:

Code: Select all

#!/bin/sh

numPro=$(ps aux | awk '{print $6,$2,$11}' | sort -nr|grep $1|head -1|awk '{print $2}')

while [ numPro=1 ];
do
numPro=$(ps aux | awk '{print $6,$2,$11}' | sort -nr|grep $1|head -1|awk '{print $2}')
SIZE=$(ps aux | awk '{print $2,$11,$6}' | sort -nr|grep $numPro|head -1|awk '{print $3/1024 " MB\t\t"}')
SIZEMB=${SIZE%.*}

echo "Process id ="$numPro" Size = "$SIZEMB" MB"
if [ $SIZEMB -gt $2 ];
then 
echo "size has been exceeded.\nKilling the process......"
`kill -9 $numPro`
echo "Killed the process"
sleep 10
else
sleep 1
echo "Size not exceeded"
fi

sleep 9
done
3) Save and close. you give execution permissions: right click on the file you give it where it says properties and then where it says permissions. Next to where it says run select. a selection symbol should appear

Now we are going to create the sh where we will indicate the processes to kill:

1) create a second text file you can name it exect_kill.sh
2) paste this:

Code: Select all

#!/bin/sh

cd ~/bin/

sh kill_mem.sh firefox 640 & sh kill_mem.sh TabNine 640
3) save and give execution permissions like the other.
4) you put exect_kill.sh at login. The easiest way is in applications at the start. If you have doubts about this part, ask.

Explanation: The name of the process can be found in the system monitor. If you want to verify that the name is correct, in the terminal:

Code: Select all

ps aux | awk '{print $6,$2,$11}' | sort -nr|grep firefox|head -1|awk '{print $2}'
In this second exect_kill.sh file you can control the processes you want for example:

Code: Select all

sh kill_mem.sh firefox 640 & sh kill_mem.sh TabNine 640 & sh kill_mem.sh chrome 640 & sh kill_mem.sh nemo 640
You will realize the pattern
1) sh to run the script
2) the one that does everything kill_mem.sh
3) name of process
3) 640 is the approx limit in mb to control the process: you can increase and decrease it at your convenience.
4) The operator & is to indicate that the script is executed in the background and allows the execution of the others

I hope I could help you.
Last edited by Juan_David95 on Fri Jan 06, 2023 1:01 pm, edited 5 times in total.
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

Ok, thanks a lot, and so how can I start it ?
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

Menard wrote: Fri Jan 06, 2023 9:34 am Ok, thanks a lot, and so how can I start it ?
Humm, well, why don't you create the first script, as indicated above, and then the second with this simple content?

Code: Select all

#!/bin/sh

cd ~/bin/

sh kill_mem.sh firefox 640 
With this you will only be monitoring firefox. Then it is necessary to put this second script in the login, so that it starts every time you log in automatically. Do you know how to put a script at the login?
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

No I guess I don't know that
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
User avatar
stevengarland
Level 5
Level 5
Posts: 835
Joined: Tue Mar 05, 2019 4:04 pm
Location: Michigan

Re: Google Chrome

Post by stevengarland »

Complex solutions can lead to complex problems
Keep It Simple Sweetheart
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

Menard wrote: Sun Jan 08, 2023 11:59 am No I guess I don't know that
It is the simplest thing in the world. Look in the linuxmint menu look for "applications at startup". There you will see all the apps that start automatically when you start ssion on your pc.

Well, at the bottom there is a + button, to add you click, then you click where it says custom order and a box will appear where you will look for the sh that you want to start automatically.

I send you a screenshot
Image


where it says navigate, there you click and look for the sh which in your case is the second script that I suggested you call exect_kill.sh, which you must create in the bin folder of your home. If the bin folder does not exist, create it and place the two scripts there. But only the second one, exect_kill.sh is the one you will set to start automatically.

Where it says name put what you want and where it says comment too, 2sec delay is fine and at the end you add and that's all.

Do not close yourself because the truth is not something difficult.

comment if you get stuck in any step.
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

stevengarland wrote: Sun Jan 08, 2023 1:14 pm Complex solutions can lead to complex problems
It's not really a complex solution. It is simply putting a script at the start of the system. Every linux user is used to that, it is the advantage of linux. Almost everything you can automate with a small script.
User avatar
Moem
Level 22
Level 22
Posts: 16230
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Google Chrome

Post by Moem »

Juan_David95 wrote: Sun Jan 08, 2023 4:30 pm It is simply putting a script at the start of the system. Every linux user is used to that
Please don't be disappointed... i've never done such a thing and I know I'm not alone.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Menard
Level 7
Level 7
Posts: 1729
Joined: Wed May 08, 2019 5:14 am
Location: Angers (France)

Re: Google Chrome

Post by Menard »

Juan_David95 wrote: Sun Jan 08, 2023 4:30 pm
It's not really a complex solution. It is simply putting a script at the start of the system. Every linux user is used to that, it is the advantage of linux. Almost everything you can automate with a small script.
On the contrary, Many Linux users installed Linux Mint because some Linux Mint users told them it was a new system that was user friendly meaning many application allready installed AND no need to use the command lines or complex system files edition ...
Linux Mint 20.3 Cinnamon - K 5.15 - Desktop - english
AMD APU A8 7600 - DDR3 1833 MHz 8 GB x2 Dual Channel
--

If you think tough men are dangerous, wait until you see what weak men are capable of.
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

Menard wrote: Mon Jan 09, 2023 5:19 amh a small script.
On the contrary, Many Linux users installed Linux Mint because some Linux Mint users told them it was a new system that was user friendly meaning many application allready installed AND no need to use the command lines or complex system files edition ...
And so it is. Linuxmint comes with almost everything out of the box.

I think it is important not to see it as something difficult, because when that is the case, the mind closes and cannot move forward. Actually in this solution you don't have to use command lines: just copy, paste, open applications at startup, which is a graphical interface and no commands.

The commands are already made in the script and it is enough to copy and paste them into a text file.

Edited: When I get free I'll try to make a video tutorial to show how easy it is.
Juan_David95
Level 2
Level 2
Posts: 73
Joined: Tue Aug 23, 2022 7:50 pm

Re: Google Chrome

Post by Juan_David95 »

Menard wrote: Fri Jan 06, 2023 9:34 am Ok, thanks a lot, and so how can I start it ?
As promised, here is the tutorial on how to implement the script to automatically kill processes. I only speak Spanish, so you can set the youtube subtitles in English.

After carrying out the steps, restart the pc, to verify that it is running.

https://youtu.be/c1K87ItpncE
Locked

Return to “Software & Applications”