maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Flash game warning! (https://talk.maemo.org/showthread.php?t=36731)

Rushmore 2009-12-11 14:41

Flash game warning!
 
Update: This does not just happen with games, it can happen with other Flash content on the page as well.

I have been testing hundreds (yes) of Flash games and it did not occur to me that they could cause problems with battery life and performance- besides the obvious impact when playing them, of course.

An example is the game "Afterglow". It is a game that loads, but does not get past the menu screen. I closed the game, but it was still resident in memory and draining the battery. The app is so agressive it activated the device even after being locked.

If you play a Flash game but then notice your device is laggy or running warm, it may be due to a Flash game still running even after closing the browser. It will show as "browsersd" and may be active when you show no open tasks. Need to go to terminal and check from there and then reboot the device if present. Audiopulse may also be running too. The combination of both has been up to 90% of cpu and 40% of memory used. UDPATE: Posts below details how to also kill em' without a reboot.

The N900 needs a task killer for this. It is fine to call this a mini-computer- but at least give me the same function to till kill tasks. When this happens with a computer, you can kill the task with ctrl-alt-delete and then find the culprit and kill it. A UI that covers this process would be good.

This has kind of sucked the fun out of playing Flash games for me, since Afterglow is not the only game that does this and it can get old to have to check after running each game.

real_per 2009-12-11 14:44

Re: Flash game warning!
 
That sounds like a serious issue. I'd like a GUI for watching running tasks as well.

Oh and, how about writing about your experiences with games, in this thread: http://talk.maemo.org/showthread.php?t=36176 ?

hopbeat 2009-12-11 14:47

Re: Flash game warning!
 
@Rushmore, you know about terminal and ps aux / kill? But I agree, that a nice gui wrapper for this would be useful. Shouldn't be to hard to do.

Nmigaz 2009-12-11 14:51

Re: Flash game warning!
 
Just a quick question, rebooting the deviice kills the process right ?

hopbeat 2009-12-11 14:53

Re: Flash game warning!
 
@Nmigaz, yes.

Pyrran 2009-12-11 14:56

Re: Flash game warning!
 
lol - just registered on the forum to pass on the info about /kill - but you beat me to it hopbeat ;)

When I've had to use kill on various linux boxes from time to time, i always use
Code:

/kill -9 pid
where pid is the process identifier as listed in the output from the 'top' command (I prefer top as it's easier to see which processes are hogging the cpu without the potential need for scrolling through the long list that the ps command can produce.

More info on the kill command here.

I'm still waiting for my n900 (anyday now) - so thanks for the headsup, definitely something to keep an eye out for.

Cheers.

Rushmore 2009-12-11 15:07

Re: Flash game warning!
 
Thanks guys!

How hard would it be for one of our fine Maemo overlords to create and add the task killer function in the UI?

hopbeat 2009-12-11 15:11

Re: Flash game warning!
 
@Pyrran, sorry for that, at least now you are a registered user (welcome :) )

@Rushmore, don't know about the overlords, the application/widget for this is not too complicated. Probably the most 'demanding' part would be to filter out processes that you do-not-really! want to kill.

Bruce 2009-12-11 17:08

Re: Flash game warning!
 
Open an xterm and type in

killall browserd

That should kill all running flash sessions.

I do not suggest running

killall -9 browserd

or

killall -kill browserd

on my N900 the -9 switch caused the phone to reboot. There are instances of browserd that run as part of Maemo.

A more precise method is to open a X-terminal then type in

top

the applications using the most cpu will be at the top of the list. Find the PID for the offending program which is in the left column of the list. Then press q to exit top and run

kill PID

If that does not work then run

kill -9 PID

Rushmore 2009-12-11 17:17

Re: Flash game warning!
 
Quote:

Originally Posted by Bruce (Post 423156)
Open an xterm and type in

killall browserd

That should kill all running flash sessions.

I do not suggest running

killall -9 browserd

or

killall -kill browserd

on my N900 the -9 switch caused the phone to reboot. There are instances of browserd that run as part of Maemo.

A more precise method is to open a X-terminal then type in

top

the applications using the most cpu will be at the top of the list. Find the PID for the offending program which is in the left column of the list. Then press q to exit top and run

kill PID

If that does not work then run

kill -9 PID

Thanks!

Is adding this type of function as part of the UI on the road-map?

Not just games can cause this. I have noticed that any Flash content on a page can cause the browser to stay active and drain the battery.

Seems like a bug / weak design of the OS and browser. I think that a lot of the random problems with battery and performance people are having is due to Flash and the OS's inability to kill the process when closing the browser.

mikec 2009-12-11 17:24

Re: Flash game warning!
 
As a slightly related topic, would it be possible to just create an icon that launched a command line script in a terminal. There could be a whole load of useful ones for "terminal afraid" users. simple ones like top, df, tracker re-index, kill browserd etc

j.s 2009-12-11 17:29

Re: Flash game warning!
 
Quote:

Originally Posted by Pyrran (Post 422875)
When I've had to use kill on various linux boxes from time to time, i always use
Code:

/kill -9 pid
where pid is the process identifier as listed in the output from the 'top' command.

More info on the kill command here.

kill should always be tried before kill -9. kill gives the application the chance to clean up after itself before exiting.

At the application level, kill -9 is like pulling the battery or power cord on a computer instead of shutting it down.

After a kill command, repeat it or otherwise check that the process really is dead. If not, then kill -9 is required.

hypnotik 2009-12-11 17:33

Re: Flash game warning!
 
Is there a flash blocker add-on for the MicroB browser? I would like to disable flash for all sites by default and only enable for certain sites (like youtube.com, etc)

Otherwise you could end up browsing on a site which has a flash advertisement without realizing it and have it drain the battery.

Flandry 2009-12-11 17:33

Re: Flash game warning!
 
Quote:

Originally Posted by Rushmore (Post 423171)
Thanks!

Is adding this type of function as part of the UI on the road-map?

Not just games can cause this. I have noticed that any Flash content on a page can cause the browser to stay active and drain the battery.

Seems like a bug / weak design of the OS and browser. I think that a lot of the random problems with battery and performance people are having is due to Flash and the OS's inability to kill the process when closing the browser.

It's a bug/weak design in Flash. It can do the same thing on desktop, and does. I regularly go in and kill the plugin process on my desktop linux distro or restart firefox in windows. If you really want to see this, try using Chrome, which gives you a finer comb to identify offending parties. You will find that you have to kill the shockwave process every now and then or your flash game tabs will get sluggish as the bloated monstrosites that Adobe has unleashed on the world leak resources.

I don't think a GUI for kill is a good idea. People not comfortable with a command line can reboot, just like they do in windows. That's safer than handing them a shotgun and dropping them into psdoom. :D

Edit: However, a shutdown script for the browser to kill flash processes or an icon for a script to do the same is a good idea. Flash bogs down my laptop enough over time that i can imagine it really could chew up a phone battery.

Pyrran 2009-12-12 01:08

Re: Flash game warning!
 
Quote:

Originally Posted by j.s (Post 423196)
kill should always be tried before kill -9. kill gives the application the chance to clean up after itself before exiting.

At the application level, kill -9 is like pulling the battery or power cord on a computer instead of shutting it down.

After a kill command, repeat it or otherwise check that the process really is dead. If not, then kill -9 is required.

Yes - that's a good point and sound advice - leaving out the -9 (i.e. just kill pid) just sends "please stop any running threads, release allocated memory and exit gracefully" type request to the running process, which should in theory be the end of the matter. Sometimes of course it isn't ;)

Personally I only use -9 to forcefully stop any running tasks that have stalled or refusing to respond to the "normal" /kill command for any reason, which sadly is all too frequently on some of the systems I look after.

So anyone new to linux and the terminal/command line please try /kill pid first, then check top again to see if the offending process is gone, if not then add the -9 switch as Bruce and j.s suggests.

Note also that it is much safer to explicitly say which process you wish to remove by using the pid, rather than the process name, e.g. browserd.

@hopbeat: thx :)

maemo.it 2010-02-11 23:30

Re: Flash game warning!
 
Quote:

Originally Posted by Bruce (Post 423156)
...There are instances of browserd that run as part of Maemo...

Which are these parts Bruce? Just curiosity.

@Flandry: how can I kill flash process on my ubuntu?
I opened a terminal and I typed: ps aux|grep flash
but nothing appeared!
thank you ;)

YoDude 2010-02-11 23:54

Re: Flash game warning!
 
Install HideUserAgent.

Whenever it is set or removed it kills browserd I believe.
If this is the case and you don't care to change the user agent then simply add the MicroB user agent as the custom one so no matter what you do the user agent stays the same but you killed browserd... savvy?

Flandry 2010-02-12 19:28

Re: Flash game warning!
 
Quote:

Originally Posted by maemo.it (Post 522119)
@Flandry: how can I kill flash process on my ubuntu?
I opened a terminal and I typed: ps aux|grep flash
but nothing appeared!
thank you ;)

I think it shows up as "npviewer.bin" in top.

maemo.it 2010-02-13 15:51

Re: Flash game warning!
 
@Flandry:
I didn't find this process in "top" neither in "ps aux|grep npviewer.bin".
:confused:
Are you sure adobe flash and my browser (firefox) are 2 different processes so I can kill flash keeping ff?

GI jack 2010-02-13 17:36

Re: Flash game warning!
 
ps aux and kill -9 worked. I checked (they do work, but I'm just kidding)

:P

it Does need a GUI version, that'd make life a lot simpler, and better for the non-techies too.

gidoca 2010-02-13 17:57

Re: Flash game warning!
 
There is a GUI-like application called htop which is pretty decent. (GUI-like here means that it runs in a terminal, but allows you to use the mouse on a PC, so I assume you can use the stylus on Maemo. I don't own a Maemo device yet unfortunately :( ) It allows you to see what process uses most of the CPU time and memory and kill them. However Flandry is right in saying that you should be careful and not be killing arbitrary processes.

Flandry 2010-02-15 14:06

Re: Flash game warning!
 
Quote:

Originally Posted by maemo.it (Post 524782)
@Flandry:
I didn't find this process in "top" neither in "ps aux|grep npviewer.bin".
:confused:
Are you sure adobe flash and my browser (firefox) are 2 different processes so I can kill flash keeping ff?

I don't know how your system setup does it but that's the way it seems to work on my kubuntu box and a 1 minute google of npviewer.bin suggests that is indeed the way it should work.

Maybe you installed a different flash implementation?

This is not really on topic for a Maemo thread so that's all i'm going to say about it.

aldevil 2010-02-15 14:14

Re: Flash game warning!
 
not only flash games even if you install new apps especially from devel-repository


All times are GMT. The time now is 17:39.

vBulletin® Version 3.8.8