1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Flash leaving behind npviewer.bin 'stuff'.

Discussion in 'Multimedia' started by dralex999, Jul 9, 2010.

  1. dralex999

    dralex999 New Member

    Messages:
    6
    Likes Received:
    0
    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 ?
     
  2. Oxyd

    Oxyd New Member

    Messages:
    167
    Likes Received:
    0
    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.)
     
  3. vermaden

    vermaden Member

    Messages:
    2,352
    Likes Received:
    2
    @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.
     
  4. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    7
    $ pkill npviewer 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.
     
  5. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,661
    Likes Received:
    23
    I have this in my user's crontab:

    Code:
    */5 * * * *	/home/myuser/flashkill > /dev/null
    This is the script:

    Code:
    
    #!/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 ;)
     
  6. ScopeDog

    ScopeDog New Member

    Messages:
    12
    Likes Received:
    0
    pkill npviewer.bin when core dumps

    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:
    #!/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

    % daemon npviewer_monitor.sh -p $$

    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.
     
  7. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,661
    Likes Received:
    23
    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.