maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [REQUEST] Optimizing not closing certain apps (https://talk.maemo.org/showthread.php?t=60930)

ivnvir 2010-08-23 11:52

[REQUEST] Optimizing not closing certain apps
 
Hi everybody.
Is there anyone here with a good knowledge about Maemo wich can make certain apps comes "pre-loaded" or closing making it sleep and vanishes from dashboard BUT stilll running (when you load it again by apps menu, it'll show again, like the MicroB, for example)?
It would be great to see quicker startup on some selectable apps as my RAM is always at 40%-50%, it think we could use it more.
Also, I see a lot of delay using the internal/external memory, it seems that most of the device lag comes from I/O, wich I suppose that doesn't happen in RAM's I/O.

Well, just an idea, lets discuss.

slender 2010-08-23 12:04

Re: [REQUEST] Optimizing not closing certain apps
 
microb launches fast because it preloaded. IIRC You can unload it with browser switcher app.

And about launch speed. Sadly they seem all bit slow (what is slow?, well to me itīs app that doesn't start in 1-2s to point where you can interact with it) to start. At least currently apps that have been made with python.

I doubt that you gain any speed increase from unloading microb. Best thing probably is to keep those programs running that you want to access fast.

thp 2010-08-23 12:05

Re: [REQUEST] Optimizing not closing certain apps
 
Won't be too difficult - just hide the main window on a destroy event (to talk in GTK+ terms) and re-show it on a D-Bus signal (i.e. when it's activated from the application manager). The only problem is that the app has to be coded to not cause unnecessary wake-ups when running in "hidden" mode and it could lead to a problem with memory consumption, as "hidden" apps still reside in memory, even if they are swapped out to swapspace.

MeeGo Touch will provide something like this built-in:

http://apidocs.meego.com/mtf/namespa...f36522ced5ffff

(it's called "prestart mode" or "lazy shutdown" there)

You can set it on MApplication:

http://apidocs.meego.com/mtf/class_m...4c965367ca7c77

AFAIK the "prestart" mode (loading before first use) is limited to built-in apps, but lazy shutdown (keeping in memory after first use) could be possible on MeeGo.

For Maemo, it's possible - it's just a matter of where it makes sense and then of implementing it. Here's how you would do it:
  • Connect to the destroy event of your main window - return TRUE and hide the main window
  • Make a D-Bus service for your application, add a "show_gui" method or something that simply shows the main window when called
  • Make the launcher script of your app call "show_gui" if the app is already running, otherwise launch the app normally

ivnvir 2010-08-23 12:18

Re: [REQUEST] Optimizing not closing certain apps
 
Quote:

Originally Posted by slender (Post 795751)
microb launches fast because it preloaded. IIRC You can unload it with browser switcher app.

And about launch speed. Sadly they seem all bit slow (what is slow?, well to me itīs app that doesn't start in 1-2s to point where you can interact with it) to start. At least currently apps that have been made with python.

I doubt that you gain any speed increase from unloading microb. Best thing probably is to keep those programs running that you want to access fast.

I want to preload other apps like microb, not kill microb... I want to preload and not kill 100% other apps.

ivnvir 2010-08-24 19:49

Re: [REQUEST] Optimizing not closing certain apps
 
Quote:

Originally Posted by thp (Post 795753)
Won't be too difficult - just hide the main window on a destroy event (to talk in GTK+ terms) and re-show it on a D-Bus signal (i.e. when it's activated from the application manager). The only problem is that the app has to be coded to not cause unnecessary wake-ups when running in "hidden" mode and it could lead to a problem with memory consumption, as "hidden" apps still reside in memory, even if they are swapped out to swapspace.

MeeGo Touch will provide something like this built-in:

http://apidocs.meego.com/mtf/namespa...f36522ced5ffff

(it's called "prestart mode" or "lazy shutdown" there)

You can set it on MApplication:

http://apidocs.meego.com/mtf/class_m...4c965367ca7c77

AFAIK the "prestart" mode (loading before first use) is limited to built-in apps, but lazy shutdown (keeping in memory after first use) could be possible on MeeGo.

For Maemo, it's possible - it's just a matter of where it makes sense and then of implementing it. Here's how you would do it:
  • Connect to the destroy event of your main window - return TRUE and hide the main window
  • Make a D-Bus service for your application, add a "show_gui" method or something that simply shows the main window when called
  • Make the launcher script of your app call "show_gui" if the app is already running, otherwise launch the app normally

Thanks for the tips, but I don't have the knowledge for doing that :(

I'll try to explain it better, since I haven't seen much interest:

- Most of the time, N900's RAMs is at 50%, this means: we can preload more apps on it and have a fast user experience launching apps;
- Most of the time, when using N900's ROM memory (the 32gb part) it slows down the system, and it's not about processing power, it's about I/O. This means: the less you read from ROM, the faster you get it (wich is true always...).
- Most of the time, I tend to close apps because I don't want them taking space at dashboard (I loose the menu shortcut), but I tend to relaunch it after a certain time.

So my idea is to have a app to control wich apps will "prelaunch" at startup and got "hidden" from dashboard... you launch it, use it, it's on dash, once you hit the close, it'll get back to RAM, hide from dashboard.
Kinda default browser.

ivnvir 2010-08-24 23:27

Re: [REQUEST] Optimizing not closing certain apps
 
uhm, really no one? everyone is happy with wasting RAM?

fnordianslip 2010-08-24 23:31

Re: [REQUEST] Optimizing not closing certain apps
 
RAM isn't actually wasted though. Its being used for disk caching, so it may very well be caching the binaries of the apps you want anyway, or something more important.

ivnvir 2010-08-25 01:12

Re: [REQUEST] Optimizing not closing certain apps
 
Quote:

Originally Posted by fnordianslip (Post 797339)
RAM isn't actually wasted though. Its being used for disk caching, so it may very well be caching the binaries of the apps you want anyway, or something more important.

The point is that 60% of the time it is around 60-70%, so I think there's room for something more.. also, there's a lot of swap space too, wich I know its not RAM...

ivnvir 2010-09-02 11:52

Re: [REQUEST] Optimizing not closing certain apps
 
Guys, i've got a little solution for my problem:
http://talk.maemo.org/showthread.php...ght=swappiness

Changing swappiness to something around 0-20 makes my RAM most of the time at 70%-90%, wich is cool.
Also, it looses less time doing swap...

I have stopped the tracker indexing too:
http://talk.maemo.org/showthread.php?t=61440

My device is responding better and the battery improved dramatically!

hqh 2010-09-02 17:01

Re: [REQUEST] Optimizing not closing certain apps
 
Quote:

Originally Posted by ivnvir (Post 797413)
The point is that 60% of the time it is around 60-70%, so I think there's room for something more.. also, there's a lot of swap space too, wich I know its not RAM...

Your figures of free ram come from conky, right? Well forget that, it doesn't show the actual physical RAM utilization.

Try "free" or "cat /proc/meminfo"
http://unixfoo.blogspot.com/2008/02/...ocmeminfo.html

Quote:

Originally Posted by ivnvir (Post 805134)
My device is responding better and the battery improved dramatically!

I honestly couldn't tell the difference based just on the "feeling". Where are your benchmark results? :)


All times are GMT. The time now is 08:14.

vBulletin® Version 3.8.8