OESF Portables Forum

Everything Else => Desktop Operating Systems Issues => Zaurus General Forums => Archived Forums => Linux Issues => Topic started by: TonyOlsen on May 11, 2004, 05:43:31 pm

Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 11, 2004, 05:43:31 pm
Is there a linux command to get a list of threads, their CPU consumption, and Memory usage?  How can you kill those individual threads?  (Wasn\'t it \"kill ...\"?)

Also, I\'ve heard people talk about setting up the programs to not load quickly, or something like that.  Appearantly some programs load into memory at boot time and just stay there so that they can load quickly when needed.  How do I turn this off?

How else can I minimize the amount of memory used during idle times?  (I have a Zaurus SL-C860 and it is using about 30 MB during idle... I suspect that can be greatly optimized).

Also... is it possible for Linux to run out of memory when there is still room in the Swap File (on my CF card)?  Are there ways around this?

How optimized is Linux with memory usage?

Thanks in advance, =)
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 11, 2004, 06:42:43 pm
Quote
Is there a linux command to get a list of threads, their CPU consumption, and Memory usage?


\'ps\' with various switches - look on google for the full list.
\'top\'

Quote
How can you kill those individual threads? (Wasn\'t it \"kill ...\"?)


kill -9 <pid>
killall -9 <processname>

Quote
Also, I\'ve heard people talk about setting up the programs to not load quickly, or something like that. Appearantly some programs load into memory at boot time and just stay there so that they can load quickly when needed. How do I turn this off?


Quickload keeps the process in memory (with files already open) so it seems to start quickly. Try holding down the stylus on the various icons until you get a pop-up menu - on this menu there will be a checkbox etc.

Quote
How else can I minimize the amount of memory used during idle times? (I have a Zaurus SL-C860 and it is using about 30 MB during idle... I suspect that can be greatly optimized).


Why do you care? During idle time you don\'t need the memory.

Note that cache memory is actually free memory which Linux is using to do something useful (cache recently used programs etc. - try a google for better info). It will be freed immediately if it is required by another app.


Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 11, 2004, 06:49:41 pm
Thanks.

Quote
Why do you care? During idle time you don\'t need the memory.


I suspect my problems with Stratagus (WarCraft2) are caused by memory issues.  I suspect it demands memory faster than the Zaurus can free it up.  I want to try running Stratagus with as much memory freed up as possible and see if it still crashes.
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: Tehas on May 11, 2004, 09:55:00 pm
There is also a package called Process Manager that allows you to see a the processes running and you can sort the list various ways.  You can also killl a procss from the GUI.

As far as Fast Load - I think that only the Sharp PIM apps support it so don\'t waste your time checking all the icons.
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 12, 2004, 05:26:51 am
Quote
I suspect it demands memory faster than the Zaurus can free it up.


I doubt this. I think memory allocation is a blocking call to the kernel so the kernel can take as long as it needs (admittedly if there were another thread waiting for that one, with a time out, etc......), plus freeing cache memory is a quick process AFAIK.

More likely your game is requesting more memory than is available or something like that.

Can you get console output from Stratagus, or a log file etc.?


Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 12, 2004, 09:32:55 am
There aren\'t any errors displayed in Stratagus... it simply freezes up the entire Zaurus.  I\'m using Zaurus SL-C860 64 MB RAM + 128 MB SwapFile (on my CF Card).

See here for more information on my problems with Stratagus, including screen shots (with digital camera) of the last moments before freezing, on this thread:

http://www.zaurususergroup.com/index.php?n...atagus&start=75 (https://www.oesf.org/forums/index.php?showtopic=3883&postdays=0&postorder=asc&highlight=stratagus&start=75)
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 12, 2004, 09:34:55 am
Quote
(admittedly if there were another thread waiting for that one, with a time out, etc......),


Maybe stratagus doesn\'t handle the memory request timeout correctly?
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 12, 2004, 11:26:19 am
That was just a guess - I\'m doubtful that the program itself would implement a timeout.
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 12, 2004, 11:29:21 am
It looks like you start the program from the terminal

try sshing in and starting it that way, then you\'ll be able to see the output up to the point where it crashes (or perhaps see that it hasn\'t actually crashed?).


Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 12, 2004, 12:08:28 pm
sshing?  Tell me more...   would the log be corrupt if the zaurus freezes and then needs a hard reboot?
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 12, 2004, 12:45:49 pm
SSH/telnet allows you to log in remotely and run things, so it\'s not logging in the way I think you mean. If the Z crashes then you just won\'t get any more info sent to your SSH/telnet window on the PC, but you\'ll still be able to see the output.

Telnet may be better for you as you\'re running the standard anglicised ROM(?), otherwise you\'ll have to install ssh - which I\'d recommend, but not just to do one thing.

Telnet may work straight away (it ought to if you log in as user zaurus). In a command prompt (on Windows or Linux) type:

telnet 192.168.129.201 (assuming this is the IP address)

then log in (username & password), then just run the commands as you would from the native terminal. You\'ll see the text output on your PC and the graphics on the Z.


Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 12, 2004, 12:53:20 pm
Ah... got it.

My Zaurus is still offline.  (Unable to get USB Network Driver working on Windows98... see http://www.zaurususergroup.com/index.php?n...light=windows98 (https://www.oesf.org/forums/index.php?showtopic=4025&highlight=windows98) thread)... so I guess Telnet isn\'t an option until after I get connected...
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 12, 2004, 01:10:45 pm
Oh, I see. How\'s about over a serial link? Do you have one of those?

I also posted a question in your other thread.

Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: Miami_Bob on May 12, 2004, 03:09:43 pm
Tony -

C860, Sharp ROM, fresh boot to Qtopia desktop, open Konsole & run \'free\' gives

total: .. 62120
used: . 38772
free: .. 23348
shared: ..... 0
buffers: .. 560
swap: ........ 0

this is with SubApplet v1.0.7 running 22 applets.

Taskman, Dash & WhatsUponZ (and probably others) all let you kill processes from the GUI.

WhatsUpOnZ gives a graphic CPU load & Memory usage history.

SystemInfo gives memory useage bar.

Memory Monitor Plugin applet pops up from the applet bar with detailed dynamic memory use info.

For some unknown reason, I seem to gain some free memory when I\'ve run a few programs after bootup & then closed them.


total: .. 62120
used: . 35368
free: .. 26752
shared: ..... 0
buffers: .. 108
swap: ........ 0


Qkonsole gives different numbers with free than Konsole.

total: .. 62120
used: . 43340
free: .. 18780
shared: ..... 0
buffers: .. 188
swap: ........ 0


Run free in Konsole, close Konsole, run free in Qkonsole, close Qkonsole, run free again in Konsole gives slightly different numbers on 2nd Knosole run compared to first one. Go figure. <G>


Bob W
Miami FL
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: Miami_Bob on May 12, 2004, 03:13:41 pm
After rereading posts - tony, can you boot directly to  command prompt & try to run (instead of terminal under GUI)?

Bob W
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 13, 2004, 07:26:59 am
In the meantime try something like (assuming this is the command you use):

./stratagus -d /mnt/cf/War2/data.wc2 &] logfile.log

Then after you reboot take a look in logfile.log


Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 13, 2004, 03:21:46 pm
How do you boot directly to command prompt in QTopia linux?
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 13, 2004, 03:41:44 pm
I tried:

Code: [Select]
./stratagus -d /mnt/cf/War2/data.wc2 &> /mnt/cf/logfile.txt

(since I don\'t have write permissions in /home/QtPalmtop/bin ).

(First time I forgot to add the \"&\" and the logfile.txt was empty.  What does \"&\" tell linux to do?)

After the crash the logfile.txt now contains:


Code: [Select]
Display size = 480x640

could not open translation file /home/QtPalmtop//i18n/zh_TW/libsl.qmid

filename:/home/QtPalmtop/lib/fonts/arial_140_50_t10.qpf

fontName:lcfont , size:10

Can\'t load the sound `neutral/units/warthog/selected/1.wav\'

Can\'t load the sound `neutral/units/warthog/annoyed/1.wav\'

Can\'t load the sound `human/units/alleria/acknowledgement/1.wav\'

Can\'t load the sound `orc/units/teron_gorefiend/acknowledgement/1.wav\'

Can\'t load the sound `human/units/kurdan/acknowledgement/1.wav\'

Can\'t load the sound `orc/units/dentarg/acknowledgement/1.wav\'

Can\'t load the sound `human/units/khadgar/acknowledgement/1.wav\'

Can\'t load the sound `orc/units/grom_hellscream/acknowledgement/1.wav\'

Can\'t load the sound `orc/units/deathwing/acknowledgement/1.wav\'

Can\'t load the sound `human/units/turalyon/acknowledgement/1.wav\'

Can\'t load the sound `human/units/danath/acknowledgement/1.wav\'

Can\'t load the sound `orc/units/korgath_bladefist/acknowledgement/1.wav\'

Can\'t load the sound `human/units/alleria/selected/1.wav\'

Can\'t load the sound `human/units/danath/selected/1.wav\'

Can\'t load the sound `human/units/khadgar/selected/1.wav\'

Can\'t load the sound `human/units/kurdan/selected/1.wav\'

Can\'t load the sound `human/units/turalyon/selected/1.wav\'

Can\'t load the sound `orc/units/deathwing/selected/1.wav\'

Can\'t load the sound `orc/units/dentarg/selected/1.wav\'

Can\'t load the sound `orc/units/grom_hellscream/selected/1.wav\'

Can\'t load the sound `orc/units/korgath_bladefist/selected/1.wav\'

Can\'t load the sound `orc/units/teron_gorefiend/selected/1.wav\'

Can\'t load the sound `human/units/alleria/annoyed/1.wav\'

Can\'t load the sound `human/units/danath/annoyed/1.wav\'

Can\'t load the sound `human/units/khadgar/annoyed/1.wav\'

Can\'t load the sound `human/units/kurdan/annoyed/1.wav\'

Can\'t load the sound `human/units/turalyon/annoyed/1.wav\'

Can\'t load the sound `orc/units/deathwing/annoyed/1.wav\'

Can\'t load the sound `orc/units/dentarg/annoyed/1.wav\'

Can\'t load the sound `orc/units/grom_hellscream/annoyed/1.wav\'

Can\'t load the sound `orc/units/korgath_bladefist/annoyed/1.wav\'

Can\'t load the sound `orc/units/teron_gorefiend/annoyed/1.wav\'

QT_GetMachine: /proc/deviceinfo/product is \'SL-C860

 a{@0e{@@e{@\'

 detected machine is \'Sharp SL-C860\'

QT_GetRotation: Read spec from \'/tmp/qtembedded-zaurus/QtEmbedded-0.spec\'

 spec is \'Transformed:Rot270:Vga:0\'

 Rot=3, Qvga=0

QT_SetVideoMode: SL-C700 Style is Input style

QT_SetVideoMode: argSize=640x480

QT_SetVideoMode: qteSize=640x480

QT_SetVideoMode: fbSize=480x640

QT_SetVideoMode: qteRotation=3

QT_SetVideoMode: userRotation=-1

QT_SetVideoMode: sdlRotation=3

QT_SetVideoMode: qteKeyRotation=3

QT_SetVideoMode: sdlKeyRotation=3
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: Miami_Bob on May 13, 2004, 03:57:38 pm
Quote
How do you boot directly to command prompt in QTopia linux?


Tony -

Try:

http://www.zaurususergroup.com/index.php?n...ht=boot+command (https://www.oesf.org/forums/index.php?showtopic=1579&highlight=boot+command)

http://www.zaurususergroup.com/index.php?n...ht=boot+options (https://www.oesf.org/forums/index.php?showtopic=2329&highlight=boot+options)


I think one of those may have the info.


RW
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 13, 2004, 04:43:26 pm
Ok... you reboot the Zaurus, select \"Yes\" to close everything, and then hold down \"D\" and \"B\" forever until the console shows up after the boot.

...but it won\'t let me run stratagus.  I\'ll continue this in the WarCraft thread...  Thanks!  

http://www.zaurususergroup.com/index.php?n...c&p=25302#25302 (http://www.zaurususergroup.com/index.php?name=PNphpBB2&file=viewtopic&p=25302#25302)
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: Stubear on May 13, 2004, 08:32:07 pm
If you want to get rid of the qtopia overhead, then just kill qpe.

as root

echo a ] /home/sharp/etc/launch.default
killall qpe

The screen will og black then you will be left with a login prompt - login as root (or zaurus if you want).
You might also need to killall qserver (or qeserver - can never remember - check with ps ax) then you should be able to start stratagus - if it is a SDL game and complins of no qeserver then don\'t kill qesever,

Stu
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: Stubear on May 13, 2004, 08:40:33 pm
As I mentioned in another thread, booting via the D+B mode doesn\'t boot into the normal filesystem - you will need to mount /dev/mtdblock3 to access any qtopia stuff

Stu
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 14, 2004, 05:30:06 am
This app needs to use Qtopia I assume (from reading the log file output), or is this just the version of SDL which it\'s using?

] redirects stdout
&] redirects stdout and stderr

The log hasn\'t given me any ideas I should add.

Sorry,

Si
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: TonyOlsen on May 14, 2004, 11:10:44 am
Thanks!

I tried all of these.  None of them worked, but now I have more knowledge about Linux.  Thanks.

This is a much nicer & easier way to get to the console... thanks.

I get many socket errors when running stratagus from this mode.  It appears to be tied into the SDL libraries, and \"ps\" only shows \"sh\" and \"ps\".  Is there a way to load the SDL libraries without QTopia?
Title: TaskManager in Linux? Freeing up memory and reducing...
Post by: lardman on May 14, 2004, 02:41:02 pm
You\'d need SDL libs specifically compiled to use the framebuffer directly I assume.

I don\'t even know whether such a beast exists.


Si

P.S. You could try using gdb and strace to step through the program and try to work out exactly where it goes wrong....