You are not logged in.

#1 2009-03-02 23:15:14

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

wmii using too much ram/cpu

wmii seems to be using more resources than openbox, which has me at a lost, 'cause I thought it was supposed to be lighter.  with nothing running but firefox, wmii itself only uses 0.2% MEM, but /bin/sh -f /home/danny/.wmii-3.5/wmiirc goes between 10-15% cpu and 10-20% mem.  I have a 1ghz proc and 1gb ram, is this normal usage?


dnyy in IRC & Urban Terror

Offline

#2 2009-03-02 23:20:39

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: wmii using too much ram/cpu

dannytatom wrote:

wmii seems to be using more resources than openbox, which has me at a lost, 'cause I thought it was supposed to be lighter.  with nothing running but firefox, wmii itself only uses 0.2% MEM, but /bin/sh -f /home/danny/.wmii-3.5/wmiirc goes between 10-15% cpu and 10-20% mem.  I have a 1ghz proc and 1gb ram, is this normal usage?

I was gonna try out wmii later tonight... This is certainly a roadblock wink

I might still go ahead and try and see if I get the same results.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2009-03-02 23:25:38

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: wmii using too much ram/cpu

Please do, I'm thinking it might just be me.  Other than this little problem though, I'm loving wmii a lot more than the other tiling WMs.  Configuration is a ton easier as well.


dnyy in IRC & Urban Terror

Offline

#4 2009-03-03 00:32:27

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: wmii using too much ram/cpu

So what does your wmiirc do?

Offline

#5 2009-03-03 01:23:58

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: wmii using too much ram/cpu

Memory as in real memory, or with buffers/cache? If it's the former, that's definitely high (I think, LOL).

Offline

#6 2009-03-03 03:17:02

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: wmii using too much ram/cpu

ataraxia wrote:

So what does your wmiirc do?

It's the default with only the colors and modkey changed (super instead of alt).  Here's the whole thing.  I just started using wmii, so I have no clue what a lot of it is doin', but I don't see how it could use so much cpu/mem.

#!/bin/sh -f
# Configure wmii

# Configuration Variables
MODKEY=Mod4
UP=k
DOWN=j
LEFT=h
RIGHT=l

# Colors tuples: "<text> <background> <border>"
WMII_NORMCOLORS='#888888 #222222 #191919'
WMII_FOCUSCOLORS='#FFFFFF #191919 #3DBEDE'

WMII_BACKGROUND='#333333'
WMII_FONT='-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'

set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
WMII_MENU="dmenu -b -fn '$WMII_FONT' -nf '$1' -nb '$2' -sf '$4' -sb '$5'"
WMII_9MENU="wmii9menu -font '$WMII_FONT' -nf '$1' -nb '$2' -sf '$4' -sb '$5' -br '$6'"
WMII_TERM="urxvt"

# Column Rules
wmiir write /colrules <<!
/.*/ -> 58+42
!

# Tagging Rules
wmiir write /tagrules <<!
/XMMS.*/ -> ~
/MPlayer.*/ -> ~
/.*/ -> sel
/.*/ -> 1
!

# Status Bar Info
status() {
    echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)
}

# Event processing
#  Processed later by `wmiiloop' and evaled.
#  Duplicate the eval line and replace 'eval' with 'echo' for details.
eventstuff() {
    cat <<'!'
    # Events
    Event Start
        case "$1" in
        wmiirc)
            exit;
        esac
    Event Key
        fn=$(echo "$@" | sed 's/[^a-zA-Z_0-9]/_/g')
        Key_$fn "$@"
    Event CreateTag
        echo "$WMII_NORMCOLORS" "$@" | wmiir create "/lbar/$@"
    Event DestroyTag
        wmiir remove "/lbar/$@"
    Event FocusTag
        wmiir xwrite "/lbar/$@" "$WMII_FOCUSCOLORS" "$@"
    Event UnfocusTag
        wmiir xwrite "/lbar/$@" "$WMII_NORMCOLORS" "$@"
    Event UrgentTag
        shift
        wmiir xwrite "/lbar/$@" "*$@"
    Event NotUrgentTag
        shift
        wmiir xwrite "/lbar/$@" "$@"
    Event LeftBarClick
        shift
        wmiir xwrite /ctl view "$@"
    # Actions
    Action quit
        wmiir xwrite /ctl quit
    Action exec
        wmiir xwrite /ctl exec "$@"
    Action rehash
        proglist $PATH >$progsfile
    Action status
        set +xv
        if wmiir remove /rbar/status 2>/dev/null; then
            sleep 2
        fi
        echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
        while status | wmiir write /rbar/status; do
            sleep 1
        done
    Event ClientMouseDown
        client=$1; button=$2
        case "$button" in
        3)
            do=$(eval $WMII_9MENU -initial "${menulast:-SomeRandomName}" Nop Delete Fullscreen)
            case "$do" in
            Delete)
                wmiir xwrite /client/$client/ctl kill;;
            Fullscreen)
                wmiir xwrite /client/$client/ctl Fullscreen on;;
            esac
            menulast=${do:-"$menulast"}
        esac
    # Key Bindings
    Key $MODKEY-Control-t
        case $(wmiir read /keys | wc -l | tr -d ' \t\n') in
        0|1)
            echo -n $Keys | tr ' ' '\012' | wmiir write /keys
            wmiir xwrite /ctl grabmod $MODKEY;;
        *)
            wmiir xwrite /keys $MODKEY-Control-t
            wmiir xwrite /ctl grabmod Mod3;;
        esac
    Key $MODKEY-space
        wmiir xwrite /tag/sel/ctl select toggle
    Key $MODKEY-d
        wmiir xwrite /tag/sel/ctl colmode sel default
    Key $MODKEY-s
        wmiir xwrite /tag/sel/ctl colmode sel stack
    Key $MODKEY-m
        wmiir xwrite /tag/sel/ctl colmode sel max
    Key $MODKEY-a
        Action $(actionlist | eval $WMII_MENU) &
    Key $MODKEY-p
        sh -c "$(eval $WMII_MENU <$progsfile)" &
    Key $MODKEY-t
        wmiir xwrite /ctl "view $(tagsmenu)" &
    Key $MODKEY-Return
        eval $WMII_TERM &
    Key $MODKEY-Shift-space
        wmiir xwrite /tag/sel/ctl send sel toggle
    Key $MODKEY-f
        wmiir xwrite /client/sel/ctl Fullscreen toggle
    Key $MODKEY-Shift-c
        wmiir xwrite /client/sel/ctl kill
    Key $MODKEY-Shift-t
        wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" "$(tagsmenu)" &
    Key $MODKEY-$LEFT
        wmiir xwrite /tag/sel/ctl select left
    Key $MODKEY-$RIGHT
        wmiir xwrite /tag/sel/ctl select right
    Key $MODKEY-$DOWN
        wmiir xwrite /tag/sel/ctl select down
    Key $MODKEY-$UP
        wmiir xwrite /tag/sel/ctl select up
    Key $MODKEY-Shift-$LEFT
        wmiir xwrite /tag/sel/ctl send sel left
    Key $MODKEY-Shift-$RIGHT
        wmiir xwrite /tag/sel/ctl send sel right
    Key $MODKEY-Shift-$DOWN
        wmiir xwrite /tag/sel/ctl send sel down
    Key $MODKEY-Shift-$UP
        wmiir xwrite /tag/sel/ctl send sel up
!
    for i in 0 1 2 3 4 5 6 7 8 9; do
        cat <<!
    Key $MODKEY-$i
        wmiir xwrite /ctl view "$i"
    Key $MODKEY-Shift-$i
        wmiir xwrite /client/sel/tags "$i"
!
    done
}

# WM Configuration
wmiir write /ctl << EOF
font $WMII_FONT
focuscolors $WMII_FOCUSCOLORS
normcolors $WMII_NORMCOLORS
grabmod $MODKEY
border 1
EOF

export WMII_MENU WMII_9MENU WMII_FONT WMII_TERM
export WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS

# Feed events to `wmiiloop' for processing
eval "$(eventstuff | sed 's/^[    ]//' | { . wmiiloop; })"

echo "$Keys" | tr ' ' '\n' | wmiir write /keys

# Functions
Action() {
    action=$1; shift
    if [ -n "$action" ]; then
        Action_$action "$@" \
        || conf_which $action "$@"
    fi
}

proglist() {
    paths=$(echo "$@" | sed 'y/:/ /')
    ls -lL $paths 2>/dev/null \
        | awk '$1 ~ /^[^d].*x/ && NF > 2 { print $NF }' \
        | sort | uniq
}

# Misc
progsfile="$WMII_NS_DIR/.proglist"
Action status &
proglist $PATH >$progsfile &

xsetroot -solid "$WMII_BACKGROUND" &

# Setup Tag Bar
seltag="$(wmiir read /tag/sel/ctl 2>/dev/null)"
wmiir ls /lbar |
while read bar; do
    wmiir remove "/lbar/$bar"
done
wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
while read tag; do
    if [ "X$tag" = "X$seltag" ]; then
        echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag" 
    else
        echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
    fi
done

# More functions
tagsmenu() {
        wmiir ls /tag | sed 's|/||; /^sel$/d' | eval $WMII_MENU
}

actionlist() {
    {    proglist $WMII_CONFPATH
        echo -n $Actions | tr ' ' '\012'
    } | sort | uniq
}

conf_which() {
    which=$(which which)
    prog=$(PATH="$WMII_CONFPATH" $which $1); shift
    [ -n "$prog" ] && $prog "$@"
}

# Stop any running instances of wmiirc
echo Start wmiirc | wmiir write /event || exit 1

wmiir read /event |
while read event; do
    set -- $event
    event=$1; shift
    Event_$event $@
done 2>/dev/null
Ranguvar wrote:

Memory as in real memory, or with buffers/cache? If it's the former, that's definitely high (I think, LOL).

I'm using htop to see it, and I'm pretty sure htop shows real usage by default. hmm


dnyy in IRC & Urban Terror

Offline

#7 2009-03-03 03:23:57

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: wmii using too much ram/cpu

In htop, VIRT is the full amount of RAM a process is using (it gets complex, but basically Linux is smart and uses more RAM than it needs to to achieve better performance, this may be 100MB for a text editor that only _needs_ 2MB and would do so if you had less RAM), RES is the real RAM a process _needs_, and SHR is the amount of RAM in RES that is likely also being used by other processes. Like I said, it's complex. Usually RES - SHR is a good stat for real RAM a process needs and is good to measure how much of a pig it's being, but RES by itself is fine in a pinch.

Offline

#8 2009-03-03 21:00:08

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: wmii using too much ram/cpu

SHR = 24992.  I'm not sure if that's terribly high, but it's more than firefox is using, which seems crazy.


dnyy in IRC & Urban Terror

Offline

#9 2009-03-03 21:24:46

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: wmii using too much ram/cpu

try ps -o rss,comm -p $(pgrep wmii)

That is in KB

Offline

#10 2009-03-03 21:43:32

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: wmii using too much ram/cpu

 2784 wmii
 1476 wmiirc
  636 wmii
  168 wmiir
  740 wmiirc
  740 wmiirc
  740 wmiirc
  816 wmiirc
  788 wmiirc
  824 wmiirc
 1476 wmiirc
  928 wmiirc
  168 wmiir
 1092 wmiirc

Alright, so that doesn't seem much.  So I'm kinda lost as to why it says its taking so much memory if it's not, I guess it's just buffer?


dnyy in IRC & Urban Terror

Offline

#11 2009-03-03 22:58:20

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: wmii using too much ram/cpu

@danny

the bash version of wmiirc (which you're using) is written in bash and they don't maintain it anymore.  they want you to install 'plan9port' package and use the bash alternative that's in there.  It's a little more friendly of a version of bash.

I use wmiirc-lua which is written by the guy that originally wrote the ruby verison, but he found out that it was pretty laggy.  he actually wrote a small lua library that can communicate with wmii through a socket rather than through text and it is working great for me.  0.2% is how much memory my wmii is using right now.  I used to use awesome but there are times I just have felt it was laggy.  like, it gets things done but there is like this slight delay and I think it has to do with how they arrange their windows.

regardless, stick with wmii and try a different (non-bash) version of the config file.  that should help.  if you can handle lua (i am starting to love it) then wmiirc-lua is the way to go.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#12 2009-03-03 23:09:39

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: wmii using too much ram/cpu

dannytatom wrote:

SHR = 24992.  I'm not sure if that's terribly high, but it's more than firefox is using, which seems crazy.

No, don't use SHR. Use RES or (RES - SHR) smile

Offline

#13 2009-03-03 23:21:04

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: wmii using too much ram/cpu

dcurtis wrote:

@danny

the bash version of wmiirc (which you're using) is written in bash and they don't maintain it anymore.  they want you to install 'plan9port' package and use the bash alternative that's in there.  It's a little more friendly of a version of bash.

I use wmiirc-lua which is written by the guy that originally wrote the ruby verison, but he found out that it was pretty laggy.  he actually wrote a small lua library that can communicate with wmii through a socket rather than through text and it is working great for me.  0.2% is how much memory my wmii is using right now.  I used to use awesome but there are times I just have felt it was laggy.  like, it gets things done but there is like this slight delay and I think it has to do with how they arrange their windows.

regardless, stick with wmii and try a different (non-bash) version of the config file.  that should help.  if you can handle lua (i am starting to love it) then wmiirc-lua is the way to go.

I'll definitely be using wmii, I like it a lot more than the others I've tried.  And thanks for the info, I'm not really into Lua due to awesome making it look so confusing.  Sucks about the ruby version, as I've been learning ruby lately and wouldn't mind using it.  Anywho, I'll look around for some nifty ones.

Again, thanks. big_smile


dnyy in IRC & Urban Terror

Offline

#14 2009-03-08 08:51:36

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: wmii using too much ram/cpu

I have been using wmii and dwm for the last couple of days. There are some things I like about wmii
1) stacking mode -- I absolutely love it for times when I don't really need tiling -- I am not sure if you can do this with dwm - if you can please let me know. I know about the monocle mode, but i was thinking if there was a way to show the title bars like in wmii
2) automatic generation/removal of views depending on whether there are windows in that view

dwm can have named views instead of numbers. I know we can do it in wmii too, using MODEKY+t, but then you lose it if you close all windows and have to recreate them. But I think I can live with numbered views big_smile

I read somewhere that wmii can be restarted without having to log out and my understanding was to select re-hash from the MODKEY+a menu. But when I do this, it spawns a new wmiirc as a process -- with additional memory allocated to it. Does that mean that there are multiple wmiircs running everytime i select rehash?
I have

until wmii; do
  true
done

in my .xinitrc

Last edited by Inxsible (2009-03-08 10:04:51)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#15 2009-03-08 09:15:24

dannytatom
Member
From: Seattle, WA
Registered: 2009-02-02
Posts: 229
Website

Re: wmii using too much ram/cpu

MODKEY+a and selecting 'wmiirc' restarts it I thought.  And I agree, I'm loving wmii a lot.  Just wish I could get it configured to not use so much resources.  That, and have named tags but still use numbers to switch to 'em.


dnyy in IRC & Urban Terror

Offline

#16 2009-03-08 09:58:52

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: wmii using too much ram/cpu

dannytatom wrote:

MODKEY+a and selecting 'wmiirc' restarts it I thought.  And I agree, I'm loving wmii a lot.  Just wish I could get it configured to not use so much resources.  That, and have named tags but still use numbers to switch to 'em.

Yeah. if you create a tag with a name, the only way to select it is using the mouse...which pretty much defeats the purpose. You can do that in dwm though.

wmii, however doesn't give me any advantage in terms of memory though. It uses about 2.2MB - 2.6MB including wmii, wmiirc from the ps_mem list, which compared to Openbox is definitely less, but not by much. My Openbox setup uses anywhere between 2.8MB - 3.5MB. So the gain is not that huge.

dwm, on the other hand does provide significant gain. it uses only 479KB. So I guess its a toss up between memory usage and a few features like stacked mode, restart of the WM and autogeneration/removal of tags

Note that I do not consider the fact that dwm doesnt have a config file. IMO, the config.h is pretty much a config file. Normally you would make changes and restart the WM -- in dwm you make the changes and install it again using makepkg -fi. Hardly any difference.

Last edited by Inxsible (2009-03-08 10:03:26)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#17 2009-03-08 19:13:15

N30N
Member
Registered: 2007-04-08
Posts: 273

Re: wmii using too much ram/cpu

Inxsible wrote:

if you create a tag with a name, the only way to select it is using the mouse.

In the default config you can change to named views with MODKEY+t. Personally I have MODKEY+f-keys mapped to the named views I use.

Offline

Board footer

Powered by FluxBB