Reply
Thread Tools
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#1
I only tested this in OS2008HE, since it is in dire need of it , but should be working in the other versions too. Of course i will not be held responsible if you send your device to hell. Didn't search the forums if this was posted before.

First create a swap file like you do it normally (from the Control Panel).

Then run a XTerm and do these commands:

Code:
swapoff /media/mmc1/.swap
dd if=/dev/zero of=/media/mmc1/.swap bs=1024 count=256000
mkswap /media/mmc1/.swap
swapon /media/mmc1/.swap
The second command is specifying the size of the swap, here it is close to 256MB, you can tweak it to your liking. This operation can also take very long time so be patient.

After restart it should remain the same size. It will reset probably if you mess again with the swap settings in Control Panel.

Last edited by Bundyo; 2008-02-26 at 19:59.
 

The Following 2 Users Say Thank You to Bundyo For This Useful Post:
MikeL's Avatar
Posts: 356 | Thanked: 27 times | Joined on Jun 2006 @ Madrid, Spain
#2
I wanted to ask about this for the Nokia770 and your post has reminded me. What happens when we swap MMC between NIT's after tweaking swap settings via xterm. (Would they revert to the norms for each OS regardless or what exactly?)
  • I have a 64MB card provided with my Nokia 770 and 56Mb or thereabouts is permanently set to a swap file on this card.
  • I have a 1GB MMC card for the Nokia 770 that I installed in my N800 (OS2008) with the adapter and it has the max of 128Mb of memory set permanently to swap.
  • When I put the larger card into the Nokia 770 it still indicates a theoretical maximum of 64MB from the control panel, memory option. (i.e. up from 56 to 64MB but not beyond to 128MB)
I am using Canola2 on my Nokia 770 with OS2006 and wish to see if increasing swap size helps at all (As long as swap space on card is available) but am wary of causing problems for the OS etc.

How would I best utilize your script cautiously where I assume card must be ideally empty of swap or any other files when running these commands
__________________
Do you Stream? You BET I Stream! http://mikesl300i.blogspot.com/
 
Posts: 98 | Thanked: 3 times | Joined on Nov 2007 @ Knightdale, NC
#3
Yes - I was looking at this for the N770 also - with 2007HE.
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#4
You can easy check if the swap resizes on the go by running an XTerm and run

Code:
free
Then swap the card and run free again. check if the swap sizes change. If they don't, that means the swap isn't remounted on the new card, try to restart and run free again.

When i have a 256MB swap, the control panel is saying 64MB, so that's not a reliable source
 
Posts: 90 | Thanked: 8 times | Joined on Jan 2006
#5
Originally Posted by Bundyo View Post
Code:
dd if=/dev/zero of=/media/mmc1/.swap bs=1024 count=256000
mkswap /media/mmc1/.swap
swapon /media/mmc1/.swap
I tried it and it is working. With
Code:
cat /proc/swaps
you can see how much swap is used.
thanks!
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#6
Originally Posted by Bundyo View Post
I only tested this in OS2008HE, since it is in dire need of it , but should be working in the other versions too. Of course i will not be held responsible if you send your device to hell. Didn't search the forums if this was posted before.
It's probably been posted several times 2 years ago, but it's nice and handy to have it repeated here just when we've flashed OS2008HE :-)
Thanks !
 
Posts: 98 | Thanked: 3 times | Joined on Nov 2007 @ Knightdale, NC
#7
I get "text file busy" on 2007HE.
 
MikeL's Avatar
Posts: 356 | Thanked: 27 times | Joined on Jun 2006 @ Madrid, Spain
#8
Originally Posted by Bundyo View Post
You can easy check if the swap resizes on the go by running an XTerm and run

Code:
free
Then swap the card and run free again. check if the swap sizes change. If they don't, that means the swap isn't remounted on the new card, try to restart and run free again.
Thanks Bundyo I checked with command "free" and live swapping between the two cards.

Sure enough swap changed in size between 56MB (For 64MB MMC), 0GB (With NO MMC) and 64MB (With 1GB MMC) (64MB being theoretical max for OS006 without making any xterm command changes) even though the physical swap size on 1GB card is actually/currently 128MB. (seems OS2006 never sees full 128MB available even under xterm when using free command)

So if I am understanding correctly I can now use your suggested commands to temporarily increase the swap size even higher on my Nokia 770 or other NIT's for an ongoing booted session and the swap size should stay that way until I hard re-boot and/or I swap cards?

i.e. create a physical 256MB swap (Using first command) which will from then on always available on a particular MMC card and then set swap size of OS (i.e. Nokia 770 OS2006 & N800 OS2008) to be in alignment using the suggested commands and all running programs will then know the extra swap space is available for use if they need it?

Just trying to get my head around the overall concepts etc.
__________________
Do you Stream? You BET I Stream! http://mikesl300i.blogspot.com/

Last edited by MikeL; 2008-02-26 at 16:33.
 
Posts: 79 | Thanked: 21 times | Joined on Sep 2007
#9
Originally Posted by Bundyo View Post
First create a swap file like you do it normally (from the Control Panel).
I don't think you need to do that first. Rather, I'd suggest not to do it, because otherwise you are writing onto a file which is currently used as swap and this doesn't sound like a good idea. Even, I'd say: If you already have a swap space, please disable it first. Either in the control panel or with
Code:
swapoff /media/mmc1/.swap
 

The Following User Says Thank You to tvogel For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#10
Yes, i forgot that unfortunately. You shoud switch off the swap before creation. I even deleted the file...

About the creation first - i'm doing that to get automatic swap mount at boot. There are other ways but this one looks easier

@MikeL: I'm not sure 'cause i didn't try, but it sounds reasonable that the swap file gets remounted if you switch cards the same way as it is on reboot - i mean with its full size.

Last edited by Bundyo; 2008-02-26 at 20:10.
 
Reply


 
Forum Jump


All times are GMT. The time now is 18:35.