maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Optimize your Nokia N900 (https://talk.maemo.org/showthread.php?t=58935)

animest4r 2010-07-22 10:21

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by JorgeFX (Post 760523)
One question... Did you guys unzip the script?? :rolleyes:

yes it is unzipped so that's why i mentioned "OptimizeN900 file" NOT OptimizeN900.zip

noipv4 2010-07-22 10:26

Re: Optimize your Nokia N900
 
Added the drop cache routines too, for even more optimized memory recovery.

#!/bin/sh

echo Your Nokia N900 is being Optimized

#Refresh the Audio Process to avoid audio glitch
killall pulseaudio

#Refresh the Tracker process
killall trackerd
killall tracker-indexer

#Refresh the browser MicroB
killall browser browserd

#Refresh of the most common applications and UIs
killall Calendar
killall osso_calculator
killall camera-ui
killall rtcom-call-ui
killall modest
killall rtcom-messaging-ui
killall image-viewer
killall osso_notes
killall osso-addressbook

#Refresh the all UI Hildon, menus and bars.
killall hildon-desktop
killall hildon-status-menu
killall systemui
#NOTE: Killing the hildon-home process can erase all widgets and that is why it is disabled
#killall hildon-home

#Refresh other processes
killall tonegend
killall mafw-gst-renderer

#drop Caches -- added by noipv4
#echo 1 > /proc/sys/vm/drop_caches
#echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

echo Your Nokia N900 is now Optimized! ;)

noipv4 2010-07-22 10:28

Re: Optimize your Nokia N900
 
1 Attachment(s)
Here's the new file attached for your convenience.
With lots of thanks to the author of this thread

PipoXtreme 2010-07-22 10:43

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by ossipena (Post 760464)
copy this to /usr/share/applications/hildon/

with filename [anything goes].desktop

(and copy the optimize script to /opt/)

This works perfect - thx for that..

JorgeFX 2010-07-22 10:45

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by noipv4 (Post 760572)
Added the drop cache routines too, for even more optimized memory recovery.

#drop Caches -- added by noipv4
#echo 1 > /proc/sys/vm/drop_caches
#echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

Thanks:D, but read this http://talk.maemo.org/showpost.php?p...8&postcount=25:D

evad 2010-07-22 11:28

Re: Optimize your Nokia N900
 
Re on:

Code:

#NOTE: Killing the hildon-home process can erase all widgets and that is why it is disabled
#killall hildon-home

You might try experimenting with following command (ran as user, not root):

Code:

/usr/sbin/dsmetool -k /usr/bin/hildon-home && /usr/sbin/dsmetool -t /usr/bin/hildon-home
This is "clean" way of restarting hildon-home (could be also used for other system processes, not sure) and will keep widgets in place.

Otherwise, good stuff, I was thinking something similar myself. Haven't tested it yet, but as my N900 is now ~4 days of uptime, I might give it a shot very soon :)

noipv4 2010-07-22 11:51

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by evad (Post 760634)
Re on:

Code:

#NOTE: Killing the hildon-home process can erase all widgets and that is why it is disabled
#killall hildon-home

You might try experimenting with following command (ran as user, not root):

Code:

/usr/sbin/dsmetool -k /usr/bin/hildon-home && /usr/sbin/dsmetool -t /usr/bin/hildon-home
This is "clean" way of restarting hildon-home (could be also used for other system processes, not sure) and will keep widgets in place.

Otherwise, good stuff, I was thinking something similar myself. Haven't tested it yet, but as my N900 is now ~4 days of uptime, I might give it a shot very soon :)

Would it be too much to request you to please post a conky image after 4days of usage?

I wanna compare the swap usage with mine. My phone crashed yesterday (3 days uptime), with 250MB Swap space usage. I could
feel the sluggishness, and was anticipating something like that.

Thanks

jupacabra 2010-07-22 12:04

Re: Optimize your Nokia N900
 
noob question guys, I keep getting the "cant open" error for this one... I have already backread from the first page of the thread to know if I did miss something, but still the error persists....

what I did was this.... downloaded the file from my desktop... then unzipped it, then I copied the file from the zip to my N900 which is connected through usb on my desktop... I just copied it on the internal memory and not inside any folders whatsoever...

Now when I open xterminal, I first enter sudo gainroot since as far as I know it is how I can run the command as root... so after the sudo gainroot I would enter the command

sh OptimizeN900

and I would receive the error that I cant open the OptimizeN900...

any help guys? Thanks!

evad 2010-07-22 12:11

Re: Optimize your Nokia N900
 
1 Attachment(s)
Quote:

Originally Posted by noipv4 (Post 760652)
Would it be too much to request you to please post a conky image after 4days of usage?

I wanna compare the swap usage with mine. My phone crashed yesterday (3 days uptime), with 250MB Swap space usage. I could
feel the sluggishness, and was anticipating something like that.

Screenshot attached, however it might not be the best example, as my N900 usage pattern has recently changed a bit and I don't use it *that* much for time being - especially for general web browsing, which tends to bloat swap space very quickly.

A thing very helpful to determine which apps/processes are leaking memory, ergo bringing performance down are endurance snapshots. I've been collecting these for a while and it was surprising to see some processes so heavily leaking memory over time. Thankfully, some of these leaks were fixed in PR1.2, but some don't and hopefully will get fixed in next firmware release.

Endurance snapshots are bit confusing to setup and start with, but definitely worth trying, I found it very useful at least. http://wiki.maemo.org/Documentation/...5/sp-endurance

AlMehdi 2010-07-22 12:14

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by jupacabra (Post 760664)
noob question guys, I keep getting the "cant open" error for this one... I have already backread from the first page of the thread to know if I did miss something, but still the error persists....

what I did was this.... downloaded the file from my desktop... then unzipped it, then I copied the file from the zip to my N900 which is connected through usb on my desktop... I just copied it on the internal memory and not inside any folders whatsoever...

Now when I open xterminal, I first enter sudo gainroot since as far as I know it is how I can run the command as root... so after the sudo gainroot I would enter the command

sh OptimizeN900

and I would receive the error that I cant open the OptimizeN900...

any help guys? Thanks!

You need to go to the folder of the Optimize900 script. You could write "find /home |grep Optimize" to find what folder it is in. Then use "cd /to/that/folder/" and "sh Optimize900".

OVK 2010-07-22 12:21

Re: Optimize your Nokia N900
 
1 Attachment(s)
Quote:

Originally Posted by evad (Post 760673)
Screenshot attached,

My Conky looks about the same (?) with seven days of uptime.

moepda 2010-07-22 12:38

Re: Optimize your Nokia N900
 
i cant get it to run either, should the OptimizeN900 file have .sh attached when on phone ? and placed in /opt/ ?, reason i ask is i have only folders in my /opt not any files out of folders, also change properties to executable ? im using winscp by the way ...

AlMehdi 2010-07-22 13:05

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by moepda (Post 760712)
i cant get it to run either, should the OptimizeN900 file have .sh attached when on phone ? and placed in /opt/ ?, reason i ask is i have only folders in my /opt not any files out of folders, also change properties to executable ? im using winscp by the way ...

If you originally put it in /home/user/MyDocs/Download you could move it with:

1. root
2. mkdir /home/opt/scripts
3. mv /home/user/MyDocs/Download/Optimize900 /home/opt/scripts
4. cd /home/opt/scripts/
5. sh Optimize900

You don't need to make it executable or put .sh in the end.

chatbox 2010-07-22 13:20

Re: Optimize your Nokia N900
 
This thread tells me two things:
1. A lot of geeks here. :-D
2. We're thinking that the N900 NEEDS to be optimized, and it's far from it.

(2,900 views in one day).

manvik60 2010-07-22 13:21

Re: Optimize your Nokia N900
 
1 Attachment(s)
Quote:

Originally Posted by moepda (Post 760712)
i cant get it to run either, should the OptimizeN900 file have .sh attached when on phone ? and placed in /opt/ ?, reason i ask is i have only folders in my /opt not any files out of folders, also change properties to executable ? im using winscp by the way ...

I normally tend to put all the custom in scripts directory and prefix with "X", so can differentiate that its a custom.
Here is what I did.
If you dont have /home/user/scripts directory, than make it.

-- copy XOptmize.png to /opt/usr/share/icons/hicolor/48x48/hildon
-- copy OptimizeN900.desktop to /usr/share/applications/hildon
-- copy the original script provided by OP to /home/user/scripts
and then you can place the XOptmize icon in your desktop.

jupacabra 2010-07-22 13:38

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by AlMehdi (Post 760677)
You need to go to the folder of the Optimize900 script. You could write "find /home |grep Optimize" to find what folder it is in. Then use "cd /to/that/folder/" and "sh Optimize900".

Thanks a lot, finally I have got to make the optimizen900 work on my end...

jaywink 2010-07-22 13:46

Re: Optimize your Nokia N900
 
Good stuff, thanks for this!

ddiscodave 2010-07-22 13:50

Re: Optimize your Nokia N900
 
i read thru this entire post and i have a few questions:

1 - is there a way to set this program up as a button or widget in the ui menu so that we wouldnt have to run it from xterm each time?
2-have you determined that there are indeed no side effects from running this program?
3 - how do you get 15 hours of uptime of your battery?????? i barely get 3 if i am lucky. i do have my internet connection up all the time for email retrieval and i use bluetooth all day as well so i am curious as to how you do it

gabby131 2010-07-22 14:17

Re: Optimize your Nokia N900
 
@JorgeFX

so before i do anything, i just want to be sure i understand:

so example i place and extract the file to /home/user/MyDocs/

then i'll just run x-term. type root (or sudo gainroot)

next
Code:

cd /home/user/MyDocs/
finally
Code:

sh OptimizeN900
is that good? :)

Crashdamage 2010-07-22 14:22

Re: Optimize your Nokia N900
 
I really appreciate the effort on this same as I do all contributions from developers, but I really don't have any need for it. My present uptime is 16 days and often goes far longer. The phone never slows down and rebooting makes zero performance difference. Maybe I'm just lucky.

But Maemo is Linux and a properly running Linux system should almost never need a reboot. So wouldn't a better approach to fixing slowdowns be to find the actual cause of any performance problems and correcting them rather than glossing them over with a Windoze-style reboot or restarting a slew of services and clearing caches?

AlMehdi 2010-07-22 14:28

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by Crashdamage (Post 760845)
I really appreciate the effort on this same as I do all contributions from developers, but I really don't have any need for it. My present uptime is 16 days and often goes far longer. The phone never slows down and rebooting makes zero performance difference. Maybe I'm just lucky.

But Maemo is Linux and a properly running Linux system should almost never need a reboot. So wouldn't a better approach to fixing slowdowns be to find the actual cause of any performance problems and correcting them rather than glossing them over with a Windoze-style reboot?

Same here.. have never experienced slow downs. Except an mp3-extension for Firefox. When i uninstalled it FF works fast again.

evad 2010-07-22 14:32

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by Crashdamage (Post 760845)
But Maemo is Linux and a properly running Linux system should almost never need a reboot. So wouldn't a better approach to fixing slowdowns be to find the actual cause of any performance problems and correcting them rather than glossing them over with a Windoze-style reboot?

You're right, generally, however bear in mind that N900 is running nearly-full Linux stack on somewhat less powerful than regular PC hardware and only 256MB of RAM, which tends to fill up fairly quickly. Imagine installing full Ubuntu or Fedora distros on PC-class hardware equivalent to N900 - it wouldn't run very quickly without certain optimizations.

That's not an excuse, tough, as on device like this OS should *already* be optimized to run flawlessly for weeks/months without need to reboot. This is not the case, unfortunately, and there are certain flaws in place, like memory leaks that undermine the performance. There are certain tools (which I already mentioned) which help to identify these issues and once you have them on your sight, it's wise to fill in a bug report, so Nokia/Maemo developers would take a look and have the chance to fix it for the next release.

AlMehdi 2010-07-22 14:33

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by ddiscodave (Post 760800)
i read thru this entire post and i have a few questions:

1 - is there a way to set this program up as a button or widget in the ui menu so that we wouldnt have to run it from xterm each time?
2-have you determined that there are indeed no side effects from running this program?
3 - how do you get 15 hours of uptime of your battery?????? i barely get 3 if i am lucky. i do have my internet connection up all the time for email retrieval and i use bluetooth all day as well so i am curious as to how you do it

My battery hold aprox 30-48h.. So you are doing something crazy when you just have 3h. I would not use bluetooth except to send files to other phones. Keep it off. If it is not important prolong the time for checking e-mail. Download BatteryGraph and test different behaviour to se what suits you and the battery best.

evad 2010-07-22 14:35

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by AlMehdi (Post 760853)
Same here.. have never experienced slow downs. Except an mp3-extension for Firefox. When i uninstalled it FF works fast again.

It might be (or probably is) a matter of one's own understanding of "slowness", as well as device usage patterns.

evad 2010-07-22 14:39

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by AlMehdi (Post 760860)
My battery hold aprox 30-48h.. So you are doing something crazy when you just have 3h. I would not use bluetooth except to send files to other phones. Keep it off.

Surprisingly, Bluetooth doesn't make that much difference in battery life. I know that as I have it on nearly all the time (listening to music via A2DP, handsfree in car etc.) and I haven't noticed so quick battery drain as one would expect.

Thing that drains battery the most, from my personal experience, is browsing the web via 3G. My N900's battery is able to make a drop of >50% within my 1-hour-long journey on train to/from work.

Sorry for non-topic rant. :)

gabby131 2010-07-22 14:39

Re: Optimize your Nokia N900
 
my n900 runs slow, but only when running "big-time" apps, and that i believe is normal.

Psycho 2010-07-22 14:46

Re: Optimize your Nokia N900
 
hmmm im very happy with this solution... maybe because you dont have it, it dont bothers you.. but believe me it is so annoying to wait 5 full seconds before ur system works again.. after unlocking... i was sick and tired off restarting every 3 days..

thnx for this solution !

mangal_sk8erboy 2010-07-22 14:50

Re: Optimize your Nokia N900
 
hey guys its a great fix.
but let this just be a temporary fix cuz we need to solve the problem on a whole n not just a workaround to refresh things.
does anyone with a class 6 mmc using it as extra ram have such problems?(ie slowing down etc.

ddiscodave 2010-07-22 15:13

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by Crashdamage (Post 760845)
I really appreciate the effort on this same as I do all contributions from developers, but I really don't have any need for it. My present uptime is 16 days and often goes far longer. The phone never slows down and rebooting makes zero performance difference. Maybe I'm just lucky.

But Maemo is Linux and a properly running Linux system should almost never need a reboot. So wouldn't a better approach to fixing slowdowns be to find the actual cause of any performance problems and correcting them rather than glossing them over with a Windoze-style reboot or restarting a slew of services and clearing caches?

CRASHDAMAGE i am right there with you man! Bravo for this great observation. I guess my question to you is, are you running a barebones system or have you installed apps that could potentially be running in the background and slowing the device down?

I, like most users, have several apps that seem to slow the device down. and i get horrendous battery life. 3 hours if i am lucky. so for me to see ppl getting 15+ hours it raises these questions in my mind.

gabby131 2010-07-22 15:39

Re: Optimize your Nokia N900
 
im going to test if joikuspot will make a difference.

note that my n900 is the client, which the one who's using other device's 3G signal (my n86).

Dr.Marcial 2010-07-22 15:40

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by noipv4 (Post 760572)
Added the drop cache routines too, for even more optimized memory recovery.


#drop Caches -- added by noipv4
#echo 1 > /proc/sys/vm/drop_caches
#echo 2 > /proc/sys/vm/drop_caches

echo 3 > /proc/sys/vm/drop_caches

echo Your Nokia N900 is now Optimized! ;)

maybe this is a nooob question, but putting a # infront of the line does inactivate the command no?
so only echo 3 in this case is being executed?

btw when I ran the script it restarted my theme as well, i was using the Black Plastic theme and it took me back to original blueish water nokia theme, is this a expected effect?

thx for the script, my n900 slows down 80% after a couple of days and its all because of Microb leak, the more i use it the slower the entire system gets.

kevloral 2010-07-22 16:31

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by JorgeFX (Post 760436)
Well, I normally use it only when I feel that the OS is getting slow but in general YES, you only have to add an event with this command:

sudo sh OptimizeN900

And you can setup this to run every day overnight. Please, try it and tell us your experiences. Thanks!;)

If you want to use it that way, it may be easier to use the suid bit. Type this as root:

Code:

chown root /opt/scripts/OptimizeN900
chmod 4755 /opt/scripts/OptimizeN900

After that, the script will always be executed as root just by typing this:

Code:

/opt/scripts/OptimizeN900
Greetings.

chemist 2010-07-22 16:42

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by evad (Post 760634)
You might try experimenting with following command (ran as user, not root):

As evad said, try to avoid using "killall"! The reason why this works so far and why it screws with hildon-home is that a watchdog is listening and assumes the processes to have crashed, run that script in a few loops and the watchdog will restart the device I guess. For example killing mce (the LED and vibra tool) or there even restarting it via init.d scsripts a few times in a row (think it was within 1-2mins) and you will find your device rebooting!
Most of the time my device gets unresponsive only hildon-home needs a restart so leaving it out makes no sense at all. Even with using dsmetool you can screw up, if for example a statusbar plugin has a daemon watching it in background a dsmetool -k hildon-status-menu can do ugly things -> http://maemo.org/community/maemo-dev...us_bar_plugin/

So to do this properly we/you should have a proper look at restarting the UX+daemons instead of rebooting the whole device or killing tasks under watchdog's ***. (Did not do it myself yet as restarting hildon-home did the job so far or the device was frozen and I needed to pull the battery because I tried something stupid ;)

javispedro 2010-07-22 18:12

Re: Optimize your Nokia N900
 
So if all the script does is restart half of the daemons in the device, why you don't do it the safe and proper way ("reboot") which would guarantee "100% Nokia N900 OPTIMIZATION!!!!!"

giannoug 2010-07-22 18:18

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by javispedro (Post 761136)
So if all the script does is restart half of the daemons in the device, why you don't do it the safe and proper way ("reboot") which would guarantee "100% Nokia N900 OPTIMIZATION!!!!!"

I have the same question too. It takes like 30 seconds to reboot, every 2 or 3 days. Why should I run / update / copy / schedule a script when I can run "reboot" in xterm?

Nice work but no use to me.

geneven 2010-07-22 18:30

Re: Optimize your Nokia N900
 
I think that the theory is that rebooting uses a lot of battery life. Do you'all disagree with that? I thought it was received doctrine.

James_Littler 2010-07-22 18:49

Re: Optimize your Nokia N900
 
does a reboot not just re-evaluate battery level? hence the apparent battery usage

mssusa 2010-07-22 18:50

Re: Optimize your Nokia N900
 
Thanks JorgeFX.

My Linux skills are a bit rusty (they weren't much to begin with :D), but aren't there some tools/programming tools to monitor the processes and find the leaks. I would install and report the logs for anything that can help pinpoint the culprits.

I do not use my N900 excessively, and almost never use the browser. I do not suffer much slow downs or unresponsiveness (except from the phone app which is always slow and stupid anyway). My current uptime is 21 days and battery life is very reasonable.

JorgeFX 2010-07-22 21:36

Re: Optimize your Nokia N900
 
Rebooting causes so much battery drain that it is not a good option with the horrible battery the N900 has. For me, I prefer not to lose % of battery

JorgeFX 2010-07-22 21:40

Re: Optimize your Nokia N900
 
Quote:

Originally Posted by evad (Post 760858)
That's not an excuse, tough, as on device like this OS should *already* be optimized to run flawlessly for weeks/months without need to reboot.

I agree! Like I said on this post: http://talk.maemo.org/showpost.php?p...0&postcount=30
It will NOT fix the bugs that NOKIA should fix, but it helps


All times are GMT. The time now is 10:02.

vBulletin® Version 3.8.8