Flash leaving behind npviewer.bin 'stuff'.

Having problems running your new shiny and blinking gadget or watching DVDs, listening to CDs etc.?

Flash leaving behind npviewer.bin 'stuff'.

Postby dralex999 » 09 Jul 2010, 03:24

I'm having a problem with flash leaving behind npviewer.bin 'things'... It tends to slow down my browsing and increases my memory usage.

I need to know why it isn't cleaned up after the web page dies and how I can modify my browser, Firefox 3.5.10, to automatically kill them... ps -ax shows many occurances of npviewer.bin . And, um, I don't like that.

Even though a killall npviewer.bin works to get rid of them and thus improves my surfing speed I'd like to know how to rid myself of this little problem permanently.

Anyone ?
dralex999
Junior Member
 
Posts: 6
Joined: 23 Jun 2010, 23:17
Location: Boise Idaho, U.S.A.

Postby Oxyd » 09 Jul 2010, 05:45

I don't think there's a fix for that. Flash is simply buggy on FreeBSD. It is not that long ago when there still was no native Flash for FBSD.

I simply use FlashBlock for Firefox, so that FF doesn't try to launch Flash for every stupid Flash-based banner, and run pkill npviewer.bin every now and then. (Or when Firefox freezes.)
User avatar
Oxyd
Member
 
Posts: 167
Joined: 20 Nov 2008, 21:27
Location: Czech Republic

Postby vermaden » 09 Jul 2010, 06:49

@dralex999

I do not use Flash enabled browser for all time browsing (Opera) and when I want to see a site with Flash, I launch Firefox with Flash enabled, and after I have seen what I wanted, I kill(1) both npviewer.bin and firefox processes.
Religions, worst damnation of mankind.
"FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM
[FILE][color="DarkSlateBlue"]http://vermaden.blogspot.com[/color][/FILE]
User avatar
vermaden
Giant Locked
 
Posts: 2316
Joined: 16 Nov 2008, 19:37
Location: pl_PL.lodz

Postby SirDice » 09 Jul 2010, 12:05

[cmd=$]pkill npviewer[/cmd] does the trick for me.

NB try not to use killall. If you're ever on Solaris killall does something completely different. It really kills all processes, including init.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16161
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby DutchDaemon » 09 Jul 2010, 18:37

I have this in my user's crontab:

Code: Select all
*/5 * * * *   /home/myuser/flashkill > /dev/null


This is the script:

Code: Select all

#!/bin/sh

flashcount=$(/bin/pgrep npviewer.bin | /usr/bin/wc -l)

if [ $flashcount = 1 ]
then
/usr/bin/killall npviewer.bin
fi


See http://forums.freebsd.org/showthread.php?p=67155#post67155 for rationale.

Works like a charm. Never looked back. Don't use it on Solaris ;)
User avatar
DutchDaemon
Old Fart
 
Posts: 10463
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

pkill npviewer.bin when core dumps

Postby ScopeDog » 30 Jul 2010, 23:06

Thanks for the script DutchDaemon, but it doesn't always kill all unused npviewer.bin.
Especially when I switch flash videos from next to next, some processes remain.

So, I tried

npviewer_monitor.sh
Code: Select all
#!/bin/sh

corefile=${HOME}/npviewer.bin.core
intervaltime=1

while getopts p:s: option
do
    case "${option}" in
    p)
        parentpid=$OPTARG
        ;;
    s)
        intervaltime=$OPTARG
        ;;
    esac
done
shift $(($OPTIND - 1))

while :
do
    procstat "${parentpid}" > /dev/null 2>&1 ||
        break

    if [ -f "${corefile}" ]
    then
        pkill npviewer.bin
        rm "${corefile}"
    fi

    sleep "${intervaltime}"
done


which I picked up at http://gihyo.jp/admin/clip/01/fdt/200810/10, and use it as

[CMD=" "]% daemon npviewer_monitor.sh -p $$[/CMD]

It pkills npviewer.bin only when npviewer.bin.core exists and I put in my ~/.xsession.
(Also, I recommend not to start it on xterm etc, because it automatically terminates when its parent process dies.)
So far, it works well.
ScopeDog
Junior Member
 
Posts: 12
Joined: 30 Jul 2010, 22:24
Location: Oregon, USA

Postby DutchDaemon » 30 Jul 2010, 23:36

Well, it hasn't failed me once since I started using it, and I don't have coredumps. Probably a slightly different setup. Whatever works for you is fine, of course.
User avatar
DutchDaemon
Old Fart
 
Posts: 10463
Joined: 16 Nov 2008, 20:17
Location: The Netherlands


Return to Multimedia

Who is online

Users browsing this forum: No registered users and 0 guests