Bitsum Community Forum

General Category => Process Lasso => Topic started by: fred999 on October 25, 2011, 01:52:14 PM

Title: Scripts
Post by: fred999 on October 25, 2011, 01:52:14 PM
Hi,
This sounds like a cool program.  I have a question.

Sometimes when I go to a web site, my pc seems to hang, and then after some minutes Windows pops a message saying "a script is running, do you wish to terminate it?" and of course I respond yes and then I can proceed with whatever.

Does PL work on restraining these scripts?  If it does lower the priority of the script, does that mean the script might run forever, since there will never be an opportunity for me to cancel it, since Windows won't have the need to send me a popup?

btw, why do these scripts have these problems?  Is it that they're coded improperly and go into a loop or something?

Thanks.
Title: Re: Scripts
Post by: hanemach_gt on October 25, 2011, 02:02:00 PM
There may be many causes of that. The most possible reason is that script is improperly written (as you mentioned) or either fell into infinite loop. Process Lasso prevents processes from "monopolizing" CPU usage, thus preventing PC from freeze. Process Lasso apparently began to restrain browser process, because that process began to utilize more and more CPU cycles, probably due of that script error.
Title: Re: Scripts
Post by: Jeremy Collake on October 25, 2011, 06:30:06 PM
Quote from: fred999 on October 25, 2011, 01:52:14 PM
Sometimes when I go to a web site, my pc seems to hang, and then after some minutes Windows pops a message saying "a script is running, do you wish to terminate it?" and of course I respond yes and then I can proceed with whatever.

We've all been there. While there are various possible causes, it is most often a [temporary] network I/O issue that resulted in a malfunctioning script. Many *assume* that a network resource will be available, and if it is not, they got haywire. Web coding usually starts with the assumption that the network I/O is reliable, and this is not a reliable assumption to make ;o.

Quote
Does PL work on restraining these scripts?

It would prevent them from monopolizing your PC to such a degree that you could not terminate them (a rare condition if you have more than one CPU since most all web sites are single threaded). For multi-core CPUs, it would help make sure that the malfunctioning page stays out of the way of other running processes.

Quote
If it does lower the priority of the script, does that mean the script might run forever, since there will never be an opportunity for me to cancel it, since Windows won't have the need to send me a popup?

No, that is feasible, not gonna happen. You'll get the same warning, same chance to cancel, and it won't get stuck running forever - so don't worry about that ;).

Also keep in mind that, by its default configuration, Process Lasso will not act on the web browser if it is the foreground application. The foreground application is the one which has the keyboard and mouse focus. So, if you don't click away, or aren't engaged doing something else, then nothing happens.
Title: Re: Scripts
Post by: Hotrod on October 25, 2011, 08:38:55 PM
I have these script problems all the time in Firefox, but it's popup asks if you wish to continue running the script. I have found most of the time it doesn't matter which I choose, the web page begins responding as soon as I make a choice. My biggest problem is that the browser will inexplicably crash and close itself sending an error report that never gets answered by the vendor. Sometimes PL shows the plugin container is the culprit, sometimes not. I have always suspected that stalled scripts are the cause, but I have found no reliable solution. I have tried all versions of FF up to ver 7. Any input on this very common problem would be welcome.
Title: Re: Scripts
Post by: fred999 on October 25, 2011, 09:05:26 PM
Quote from: bitsum.support on October 25, 2011, 06:30:06 PM

Also keep in mind that, by its default configuration, Process Lasso will not act on the web browser if it is the foreground application. The foreground application is the one which has the keyboard and mouse focus. So, if you don't click away, or aren't engaged doing something else, then nothing happens.

Ohhh, ahh, well, so there will be no relief, because when I'm surfing, the web page will be the foreground.... unless there's a special control just for this occasion?

Title: Re: Scripts
Post by: Jeremy Collake on October 25, 2011, 09:10:50 PM
Quote from: fred999 on October 25, 2011, 09:05:26 PM
Ohhh, ahh, well, so there will be no relief, because when I'm surfing, the web page will be the foreground.... unless there's a special control just for this occasion?

Well, if it is causing a big responsiveness problem, then you can click away, but if you are browsing and this happens, there is nothing that can be done. In simple terms, if you are actively browsing, you want all your CPU resources to hopefully get through that script, ya know? Anyway, Process Lasso can do nothing to fix 'hung script' problems.. it is a totally different issue, and not at all resolvable. The only way to resolve it is by doing what browsers do, ask you if you want to give up .. or keep waiting.

HOWEVER, if you were doing something ELSE, and this script problem happened in the BACKGROUND, then Process Lasso's ProBalance would help keep it from affecting whatever you were doing in the FOREGROUND.

EDIT: Of course, there is a special option to NOT exclude foreground processes too, but I wouldn't think it would really help you to be honest ... and would not recommend it. This is just a totally different issue... and there is no magic bullet.. so don't let anyone lie to you and tell you there is.
Title: Re: Scripts
Post by: Miroku4444 on October 25, 2011, 09:33:20 PM
QuoteSometimes PL shows the plugin container is the culprit, sometimes not.

If plug-in container is causing trouble you can dis-able it. I have mine disabled. It was sucking way too much memory usage. Plugin container runs when you use flash, QuickTime, Microsoft Silverlight, etc.. It's suppose to keep these plugins running if there was a crash with one of them. I've never had any of them crash, so i don't need plugins container sucking my resources. Here's how to dis-able plug-in container from Mozilla's official forum.

http://kb.mozillazine.org/Plugin-container_and_out-of-process_plugins#Disabling_crash_protection
Title: Re: Scripts
Post by: Jeremy Collake on October 25, 2011, 09:37:22 PM
Ah, yes, that is true, if the cause is the plugin-container (or equivalent background process), then ProBalance WILL help retain responsiveness ... but not solve the underlying issue, of course. Usually I assume these type issues are Javascript running in the browser, which is what I assumed here, but it varies -- when it says 'a plug-in' instead of 'a script', Process Lasso is more likely to be able to help retain responsiveness. To fix the underlying issue the web coders and plug-in writers would have to write better code and/or your network would have to be more reliable.
Title: Re: Scripts
Post by: fred999 on October 25, 2011, 10:36:56 PM
Quote from: bitsum.support on October 25, 2011, 09:10:50 PM
Well, if it is causing a big responsiveness problem, then you can click away, but if you are browsing and this happens, there is nothing that can be done. In simple terms, if you are actively browsing, you want all your CPU resources to hopefully get through that script, ya know? Anyway, Process Lasso can do nothing to fix 'hung script' problems.. it is a totally different issue, and not at all resolvable. The only way to resolve it is by doing what browsers do, ask you if you want to give up .. or keep waiting.

HOWEVER, if you were doing something ELSE, and this script problem happened in the BACKGROUND, then Process Lasso's ProBalance would help keep it from affecting whatever you were doing in the FOREGROUND.


Yes, I see.  I suppose I could click away and start a new browser and do what I want in the second browser, until the first one came back... very neat.  Do you see any issue with that? 

Thanks.
Title: Re: Scripts
Post by: edkiefer on October 25, 2011, 11:28:39 PM
but the default is to have the plugin -container set excluded of probalance , is that right ?
Title: Re: Scripts
Post by: hanemach_gt on October 26, 2011, 01:26:24 AM
Yes, plugin-container is excluded by default, at least for me (I have the latest beta).
Title: Re: Scripts
Post by: Miroku4444 on October 26, 2011, 02:09:43 AM
Just disable it in firefox guys.
Title: Re: Scripts
Post by: Jeremy Collake on October 26, 2011, 06:28:16 AM
Yes, you have to un-exclude it, my mistake for saying it would occur with the default config.
Title: Re: Scripts
Post by: edkiefer on October 26, 2011, 08:57:46 AM
Ok, thanks , I have no issue with it , so i will leave it be .
What was the thinking to exclude plugin-container in first place and not firefox process(firefox is understandable) . To not limit any backround activity to be hindered/slowed down ?

Miroku4444 : when disabling in firefox so only one process is running did you notice any ram saving or it just adds what usage plugin-container uses to firefox.exe process , just curious if you noticed any difference .
Title: Re: Scripts
Post by: Miroku4444 on October 26, 2011, 09:31:23 PM
QuoteMiroku4444 : when disabling in firefox so only one process is running did you notice any ram saving or it just adds what usage plugin-container uses to firefox.exe process , just curious if you noticed any difference .

No, plugin-container is a separate process. It doesn't hog anything from firefox.exe. It uses memory and is a CPU hog at times to your PC on its own. Open the task manger when its running and you'll find it there sucking resources.
Title: Re: Scripts
Post by: edkiefer on October 26, 2011, 10:46:41 PM
Quote from: Miroku4444 on October 26, 2011, 09:31:23 PM
QuoteMiroku4444 : when disabling in firefox so only one process is running did you notice any ram saving or it just adds what usage plugin-container uses to firefox.exe process , just curious if you noticed any difference .

No, plugin-container is a separate process. It doesn't hog anything from firefox.exe. It uses memory and is a CPU hog at times to your PC on its own. Open the task manger when its running and you'll find it there sucking resources.

no what i meant was say plugin container process is using 100mb and firefox is using 200mb , if I disable the seperate plugin container process does the firefox.exe process go to 300mb ?
Title: Re: Scripts
Post by: hanemach_gt on October 27, 2011, 08:54:06 AM
Yes, I guess. That plugin-container is meant to save firefox.exe from getting hung if some plugin crashes.
Title: Re: Scripts
Post by: Jeremy Collake on October 27, 2011, 09:12:13 AM
The reason plugin-container.exe is excluded by default is due to the interdependence between it and the firefox browser. To lower its priority could affect performance of the firefox web browser, if it is in active use (in the foreground). Whether the preference should be to keep it excluded or not is debatable, and requires further study. A dynamic exclusion of this particular process may be in order, so that it is excluded only when the firefox browser is in the foreground.

As always, whenever there is doubt, the process is excluded. The 'play it safe' philosophy is very important to Process Lasso's tuning.

As I've mentioned many times, Chrome actually forks its processes so that each tab has its own instance of Chrome. No, this does not waste any memory since duplicate virtual memory is shared between processes. To get technical, it is shared until written to by a specific instance, then a private copy of that shared memory is made for that instance (called copy on write). Anyway, I digress...

My point is that Chrome also lowers the priority class of background tabs (processes) when they are not active. This sort of self-regulation is very similar to what ProBalance does, and it could be that newer versions of Firefox also do the same on a thread level. I have not verified this assertion though.

The largest point to be made is that, sadly, browser crashes and hung scripts are not likely to be mitigated by Process Lasso to any significant degree. The only thing Process Lasso's ProBalance may do is mitigate the effects of such an occurrence on the rest of the system. I could work on better systems to detect error conditions, but as you see - Firefox, and indeed Windows itself (NT6+), already does so. Therefore, the solution you may hope for is probably not to be found within Process Lasso ;o.

--- Now that I've hopefully made it clear there is no magic bullet, the decision to isolate, or not isolate Firefox plug-ins within the separate process plugin-container.exe is something you can play with, as Miroku4444 suggested. This may indeed influence the crash or other error condition that you are experiencing, though the only way to find out is to try.
Title: Re: Scripts
Post by: edkiefer on October 27, 2011, 09:58:38 AM
Thanks for explaining that, that is kind of what I figured , like a multi-threaded app that runs threads in parallel but were talking processes .

As far as Firefox, for me its been yrs since it crashed but I run bare min extensions/plug-in's .