maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   additional swap file (https://talk.maemo.org/showthread.php?t=86752)

wook_sf 2012-09-10 10:12

additional swap file
 
i believe that linux should have some swap, maybe not 2GB (i use one GB) but, it should have some space for this.
especially, it's not big deal if mass storage is in some other file system than FAT.
related to:
https://www.linux.com/news/software/...ux-swap-space/
i've made some little tests and i think so far there's lot of ways to speed up phone little bit and this is one of first steps.

this is only for super advanced users and no one is responsible if you damage anything with this, it's also only for those who don't connect phone to mass storage very often.


it's important to note that swap is not replacement for RAM and it will not make "visible" changes to your device (like more ram....)
so, here we go:
need: sudo package and probably open mode kernel?

Code:

$ sudo su
# dd if=/dev/zero of=/home/user/MyDocs/.swap0 bs=1024 count=2097152
# mkswap /home/user/MyDocs/.swap0
# swapon /home/user/MyDocs/.swap0

Code:

free
Code:

/etc/init/apps/swapp-add.conf
Code:

description "additional swap file for harmattan"
author "wook dot ba at gmail dot com"
stop on stopping xsession
console none
respawn
nice 2

env DISPLAY=:0.0

pre-start script
    swapon /home/user/MyDocs/.swap0
end script

download swap-add.conf

little automatization:

scripts for "quick" add/rem /home/user/MyDocs/.swap0:
copy them to /sbin/ or /bin/ or /usr/bin and do:
Code:

#chmod +x setswap0
#chmod +x rmswap0

download setswap0
download rmswap0

###############

additional notes:
line dd if=/dev/zero of=/home/user/MyDocs/.swap0 bs=1024 count=2097152 means: fill /home/user/MyDocs/.swap0 with zeros in block size 1024 for 1024*2048 so maybe you will want to replace it with 1024*1024 (1048576)

to view swap files use:
# cat /proc/swaps
to view memory:
$ free

only for advanced users!!!

thedead1440 2012-09-10 10:27

Re: additional swap file
 
works well here ;)

Just hope AMD comes and tries this out too... That would make it so fun...Haha :D

wook_sf 2012-09-10 10:30

Re: additional swap file
 
thanks for report :P

hahahahaha :D well, we'll send him to Arie :P but, you should explain procedure to him ;) :D

rainisto 2012-09-10 19:37

Re: additional swap file
 
Running swap on flash of course kills the flash memory at some point. Just a word of caution.

But having said that, I have always wondered why nobody has enabled the near 500MB extra mtd block device that is unused on the Harmattan devices. ;-)

I give this as a hint: /etc/init/enable-swap.conf (with couple changes (remember to resign hashlist or you malf your device) you can gain 256MB more free ram (when disabling ramz) and gain almost 500MB swap). And it doesn't mess your mass storage size.

wook_sf 2012-09-10 19:57

Re: additional swap file
 
Quote:

Originally Posted by rainisto (Post 1264402)
Running swap on flash of course kills the flash memory at some point. Just a word of caution.

But having said that, I have always wondered why nobody has enabled the near 500MB extra mtd block device that is unused on the Harmattan devices. ;-)

I give this as a hint: /etc/init/enable-swap.conf (with couple changes (remember to resign hashlist or you malf your device) you can gain 256MB more free ram (when disabling ramz) and gain almost 500MB swap). And it doesn't mess your mass storage size.

well, eventually it will be dead anyway :D it can't last for ever though, but that's really good idea and i'll give it a try, though i am very newbie into nux under core and i was always wondering why there's no much tweaks/mods....either everyone is happy with phones, or ...:D
thanks for this hint :)

thedead1440 2012-09-14 16:40

Re: additional swap file
 
My output of free:

Code:

RM696-21-3_PR_005:~# free
                total              used            free      shared      buffers
Mem:      1008108      908720        99388            0        44816
-/+ buffers:            863904      144204
Swap:      2359280      12264          2347016


wook_sf 2012-09-14 16:45

Re: additional swap file
 
Quote:

Originally Posted by thedead1440 (Post 1266413)
My output of free:

Code:

RM696-21-3_PR_005:~# free
                total              used            free      shared      buffers
Mem:      1008108      908720        99388            0        44816
-/+ buffers:            863904      144204
Swap:      2359280      12264          2347016


huh, it looks to me like DDoS from somewhere :D
2347016 in swap....i am wondering what's there :S :D

thedead1440 2012-09-14 16:45

Re: additional swap file
 
oh wook all dead parrots in there :p :p

wook_sf 2012-09-14 16:46

Re: additional swap file
 
Quote:

Originally Posted by thedead1440 (Post 1266418)
oh wook all dead parrots in there :p :p

ahahahaha, kill em all :D

thedead1440 2012-09-15 13:06

Re: additional swap file
 
Quote:

Originally Posted by rainisto (Post 1264402)
Running swap on flash of course kills the flash memory at some point. Just a word of caution.

But having said that, I have always wondered why nobody has enabled the near 500MB extra mtd block device that is unused on the Harmattan devices. ;-)

I give this as a hint: /etc/init/enable-swap.conf (with couple changes (remember to resign hashlist or you malf your device) you can gain 256MB more free ram (when disabling ramz) and gain almost 500MB swap). And it doesn't mess your mass storage size.


I guess you mean mtd6 block?


All times are GMT. The time now is 15:32.

vBulletin® Version 3.8.8