Reply
Thread Tools
Posts: 359 | Thanked: 322 times | Joined on Jun 2010
#1
My N9 is fastest in every way when swap memory usage is lowest. Emails swipe faster, homescreens swipe faster, and I think that swap-related slowdown is one of the primary reasons N9 owners are rebooting all of the time--because rebooting resets the swap memory.

I have seen other threads that discuss complex (and admittedly risky) ways to add swap capacity to our N9s, but I have a much more simple question:

How can we reset the swap memory as if we had rebooted without actually rebooting? After looking and searching I have yet to find an answer. I imagine that there must be a command that could be put in Profilematic or simply entered from time to time that would do the job, but what is it?

This could be a game-changer for many users, since clean swap positively impacts my N9's speed performance as much as FasterN9 and light overclocking.

Thanks.
__________________
Hitting this thanks button will make you smile and feel good ----------------------------------------------------------------->
 
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#2
Well, I don't use OC, I don't use FasterN9, and still I find the performace good all the time regardless of uptimes...
(well it's only 7 days now because I did some boot stuff back then... but generally I only boot my device when I need to change to different kernel/OS...)

I do not think you need to boot your devices regularily to have good performance. If that's required, then you have misbehaving applications or you have yourself done some tuning of the device that has turned sour.
 

The Following 2 Users Say Thank You to juiceme For This Useful Post:
pichlo's Avatar
Posts: 6,450 | Thanked: 20,983 times | Joined on Sep 2012 @ UK
#3
Originally Posted by Hacker View Post
My N9 is fastest in every way when swap memory usage is lowest. Emails swipe faster, homescreens swipe faster, and I think that swap-related slowdown is one of the primary reasons N9 owners are rebooting all of the time--because rebooting resets the swap memory.
I thought the whole idea of swapping is to put the less used memory blocks out of the way but have them ready when needed. Resetting the swap would mean that the next time the memory block is needed, it will have to be reinitialized again which is slower than fetching it from the swap. It is true that the swap space may become fragmented in which case a reset may help a little but you will get a better performance boost by closing applications to reduce the absolute memory usage.

How can we reset the swap memory as if we had rebooted without actually rebooting? After looking and searching I have yet to find an answer.
Have you found this?

http://talk.maemo.org/showthread.php?t=84007

You can reset the swap by running (as root)
Code:
swapoff -a
swapon -a
I won't recommend it though. I don't have an N9, but on my N900 this takes a LONG time (minutes) and results in some background tasks forcibly closed as they can't allocate memory while the swap is off.

A better solution would be having TWO swap spaces and from time to time swap (no pun intended) between them. This has been discussed a number of times. See e.g.

http://talk.maemo.org/showthread.php?t=42357
http://talk.maemo.org/showthread.php?t=84296
http://talk.maemo.org/showthread.php?t=86752

...and many others. Some of them discuss the N900 but the solution is actually the same for the N9.
 

The Following 3 Users Say Thank You to pichlo For This Useful Post:
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#4
I am not sure but is this what you are looking for?

http://store.ovi.com/content/258450?...e=search&pos=1
__________________
────────────────────
Try:My N9 bootvideo
 

The Following User Says Thank You to Mikkosssss For This Useful Post:
Posts: 32 | Thanked: 22 times | Joined on Jul 2012 @ Germany
#5
Maybe Dropcache http://store.ovi.com/content/258450 help you out:
(dropcache and inception required)

Code:
terminal command:
aegis-exec /opt/dropcache-mdn/bin/dropcache.sh --3
The linux kernel has it's own algorithm to do this ... so i think it isn't a good idea to periodically force a swap flush either
 

The Following User Says Thank You to Lirion For This Useful Post:
Posts: 359 | Thanked: 322 times | Joined on Jun 2010
#6
Thanks for the responses! I have read and researched what everyone has said and here's some feedback.

Originally Posted by juiceme View Post
Well, I don't use OC, I don't use FasterN9, and still I find the performace good all the time regardless of uptimes...
(well it's only 7 days now because I did some boot stuff back then... but generally I only boot my device when I need to change to different kernel/OS...)

I do not think you need to boot your devices regularily to have good performance. If that's required, then you have misbehaving applications or you have yourself done some tuning of the device that has turned sour.
Hmmm, given the number of users who use FasterN9, overclocking, etc., slow performance is an issue for many of us! Maybe you have an exceptional N9 or you have different expectations. :-) The problem is not misbehaving apps (I used top command and Conky to check); but rather it seems to be that swap memory is not being freed up even after the related apps are closed, so you eventually use more and more of the available swap memory, causing the N9 to slow down more and more.

The swap-related slowdown issue is discussed in this thread: http://talk.maemo.org/showthread.php?t=84007

I started this thread in hopes that an answer could be found to the swap-reset question. Once we have an answer, It can be merged in a solution thread.

Originally Posted by pichlo View Post
I thought the whole idea of swapping is to put the less used memory blocks out of the way but have them ready when needed. Resetting the swap would mean that the next time the memory block is needed, it will have to be reinitialized again which is slower than fetching it from the swap. It is true that the swap space may become fragmented in which case a reset may help a little but you will get a better performance boost by closing applications to reduce the absolute memory usage.

Have you found this?

http://talk.maemo.org/showthread.php?t=84007
Yes, I have found that thread, and while your theory seems plausible, it clearly is not working out in real life because several users, including users in the thread that you quote, are having the same problem with swap-related issues! ;-) If the memory were behaving as expected and not causing slowdown, I suppose most of these types of threads would not exist. The problem, I think, is as I stated above: that even closing programs that caused the swap memory to be used does not free swap mem., so it is inevitably exhausted and leads to slower and slower performance.

Originally Posted by pichlo View Post
You can reset the swap by running (as root)
Code:
swapoff -a
swapon -a
I won't recommend it though. I don't have an N9, but on my N900 this takes a LONG time (minutes) and results in some background tasks forcibly closed as they can't allocate memory while the swap is off.
This approach was discussed in the thread you quote and did not work. :-( Has anyone with an N9 used this approach successfully? I will run a confirmation study when I have a chance.

And thanks for the two swap spaces ideas and research threads. I'll check them out, but am still looking for a workable, easy swap reset approach that avoids reboot.

Mikkosssss and Lirion, I have tried Dropcache, but as discussed in the thread discussed above, it does not seem to solve the problem of freeing swap memory (though it is very useful in tracking the problem as it shows the amount of free swap memory).

Thanks again, everyone.
__________________
Hitting this thanks button will make you smile and feel good ----------------------------------------------------------------->
 
TMavica's Avatar
Posts: 2,021 | Thanked: 1,060 times | Joined on Apr 2010 @ Hong Kong
#7
Swap memory cant be free up except booting, only way is to add more swap memory from 255 to 412
__________________
The Glorious Lady T.Mavica
Twitter https://twitter.com/TMavica
 

The Following User Says Thank You to TMavica For This Useful Post:
Posts: 359 | Thanked: 322 times | Joined on Jun 2010
#8
Originally Posted by TMavica View Post
Swap memory cant be free up except booting, only way is to add more swap memory from 255 to 412
Why? This seems so strange . . . Please help me understand. Is it a bug?

I saw your earlier post, so any insight would be much appreciated.
__________________
Hitting this thanks button will make you smile and feel good ----------------------------------------------------------------->
 
TMavica's Avatar
Posts: 2,021 | Thanked: 1,060 times | Joined on Apr 2010 @ Hong Kong
#9
Sorry I dont know why, just know many developer said CANT..I dont know the reason and the meaning, just I know is cant
__________________
The Glorious Lady T.Mavica
Twitter https://twitter.com/TMavica
 

The Following User Says Thank You to TMavica For This Useful Post:
pichlo's Avatar
Posts: 6,450 | Thanked: 20,983 times | Joined on Sep 2012 @ UK
#10
Originally Posted by Hacker View Post
Originally Posted by TMavica View Post
Swap memory cant be free up except booting, only way is to add more swap memory from 255 to 412
Why? This seems so strange . . . Please help me understand. Is it a bug?
Look at these figures:
Code:
N900:~# free
             total         used         free       shared      buffers
Mem:        235252       232012         3240            0         1784
-/+ buffers:             230228         5024
Swap:       786424        71540       714884
Of course they will be different on your N9 or even on the next guy's N900, but the idea is the same. The total used memory (main + swap) is higher than the amount of available main memory. Which means some pages have to be swapped. The only way to get around this is by increasing the amount of main memory, which is clearly not possible.

One way of reducing the impact of swapping is spreading the bandwidth, such as one swap partition in the device and one on the SD card, as discussed in those threads that I linked in my first reply.

EDIT: I am actually a bit surprised how much main memory is used before swapping occurs (or how little main memory is left free). My gut feeling would be to strive for at least 20% slack, which would mean even more swap usage. Obviously the Hildon programmers knew better.

Last edited by pichlo; 2013-03-21 at 20:25.
 
Reply


 
Forum Jump


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