LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-27-2017, 04:03 PM   #1
Bogomips_
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Rep: Reputation: Disabled
Question Browser Javascript Process Launcher PID


Is it possible to find out the PID, if such exists of the Mozilla browser process which launches Javascripts?

Oddly enough have just now had to turn off Javascript, because while browsing the main page of this forum, memory usage went ballistic, swap jumped 300 MB and CPU 100%. All froze until browser came up with option to stop unresponsive script, some almost 5 minutes later.

Am fed up with some five minutes after disabling Javascript and minimising browser the whole system freezes due to unresponsive google apis script, best part of 10 minutes system incapacitated.

Flash hogging of system, am able to resolve by killing plugin-container, and it would be great if something similar for Javascript existed. Short of closing browser would like to terminate all running scripts before minimising browser.
 
Old 01-27-2017, 08:49 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
try this

Code:
pgrep -u $USER program name
example

Code:
(userx@slacko/~)>>$ pgrep -u $USER firefox
11862
 
Old 01-28-2017, 04:58 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Bogomips_ View Post
Is it possible to find out the PID, if such exists of the Mozilla browser process which launches Javascripts?
X-Y-problem!!!

something is clearly wrong with your browser, however that is not the solution.

what system, what distro, what browser (version), what addons?
and are you shutting down your browser regularly and cleaning up local files and do NOT use the restore tabs option?

answer these and we might get somewhere.

also, good you switched off javascript execution for now.
also flash should only be allowed to run after you explicitely allowed it by clicking on it.
addons exist to allow javascript selectively (noscript). a pain to get used to, but worth the effort on low hardware specs.
adblockers also, because besides just sucking, ads also suck resources.

Last edited by ondoho; 01-28-2017 at 05:00 AM.
 
Old 01-28-2017, 04:28 PM   #4
Bogomips_
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by ondoho View Post
something is clearly wrong with your browser, however that is not the solution.
Possibility have been considering. Browser is Light

Quote:
what system, what distro, what browser (version), what addons?
Linux Kernel 4.9.0, Porteus 3.2.2 KDE5, Light 47.0
Extensions: Another Restart, FEBE, FlashDisable, LastPass, Silent Block, storeTab, (new) disallow Script

Quote:
and are you shutting down your browser regularly and cleaning up local files
No problem here as running in RAM. Only persistence being the browser profile kept on real filesystem.

Quote:
do NOT use the restore tabs option?
Something to bear in mind. Been using it on PaleMoon without problem. Could be that here profile has been contaminated. Must try and eliminate that possibility.

Quote:
addons exist to allow javascript selectively (noscript). a pain to get used to, but worth the effort on low hardware specs.
adblockers also, because besides just sucking, ads also suck resources.
Gave up on noscript as one was being asked to make decisions about browser hijacking etc., which presumed expert knowledge of script tricks. Just use Silent Block, as URLs can be specified as regex, meaning sometimes let googleapis through and sometimes block, depending on context of URL. Also have added a user.js to browser profile.

Lastly, funnily enough after posting here got an X Y Solution. Searching for X found Y, being the 'disallow Script', which I thought had fallen by the wayside with FF 44, but apparently still very much alive. This blocks scripts per tab, meaning am able to just allow scripts to run in one tab. Not quite functioning completely properly as it used to do, at the moment, but at least going some of the way. Although providing a partial solution will not deter from quest to find the silver bullet: kill -- -<PID>!

Last edited by Bogomips_; 01-28-2017 at 04:36 PM.
 
Old 01-29-2017, 07:11 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Bogomips_ View Post
Browser is Light
Linux Kernel 4.9.0, Porteus 3.2.2 KDE5, Light 47.0
Extensions: Another Restart, FEBE, FlashDisable, LastPass, Silent Block, storeTab, (new) disallow Script
a browser unsupported on most probably ANY linux distro, a larger number of addons, still no info on your hardware.
i see many reasons why your cpu could jump to 100% sometimes.

Quote:
Although providing a partial solution will not deter from quest to find the silver bullet: kill -- -<PID>!
i don't think the javascript has its own pid, it's just part of the browser process.
but i might be wrong, so keep reading those docs!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser Javascript Process Launcher Bogomips_ Linux - General 1 01-28-2017 04:54 AM
[SOLVED] How to save the pid of a process at the time of process startup jhonnappier2007 Linux - Newbie 13 11-20-2011 11:54 PM
how to get the name of process from PID in C/C++? kulandaivelu Programming 3 02-03-2009 09:41 AM
How to get the PID of the process giving kill signal to a process? hariprd Programming 2 11-27-2008 03:10 AM
pid of a process kushkothari Programming 8 11-19-2008 05:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration