Notices


Reply
Thread Tools
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#41
Originally Posted by saponga View Post
Thanks man... I'll do that as soon as i could get a PC.
PC? Can be done on device with a text editor.

However, it maybe something else as your uptime isn't high enough to cause the issue I am thinking of.

If you run the script in a terminal and post the output, I maybe able to see were the script is failing better.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#42
Hey sixwheeledbeast,

smells again like an int32 overrun of bytes.
Why you do not change like this
kbytes=$(($ublocks/2)) ?
This way you will get used kbytes since start and you may count up to TB instead of GB.

Just out of the head without checking...
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 432 | Thanked: 917 times | Joined on Jun 2011
#43
Originally Posted by sixwheeledbeast View Post
PC? Can be done on device with a text editor.

However, it maybe something else as your uptime isn't high enough to cause the issue I am thinking of.

If you run the script in a terminal and post the output, I maybe able to see were the script is failing better.
Sorry. My lazyness stops me to read the whole script by the time i did copy that line 38 and i was thinking thai i'll need to edit tons of lines. Just after i did post i took a look on the script and found out that is onle the shebang. I'm installing bash rigth now.
Thanks
EDIT: that was the output from the xterminal.
Code:
/opt/flopswap/script $ sh swapused.sh
ublocks
swapused.sh: line 38: arithmetic syntax error
EDIT 2: HAM is slow like hell... Since it isn't an emergency, i will not overload the new mirrors. As soon as i get bash i'll report back.
thanks man.

Last edited by saponga; 2013-01-25 at 00:38.
 

The Following User Says Thank You to saponga For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#44
Originally Posted by peterleinchen View Post
Hey sixwheeledbeast,

smells again like an int32 overrun of bytes.
Why you do not change like this
kbytes=$(($ublocks/2)) ?
The issue is we are still going to eventualy end up at int32 overrun after a fair amount of uptime.

If this is the int32 issue I need to look at another way.
Maybe either bash3 as a dep or thinking about using a timed method again.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
Posts: 432 | Thanked: 917 times | Joined on Jun 2011
#45
Originally Posted by sixwheeledbeast View Post
I had this before, it's due to busybox.

Out interest what's your uptime?

Two things to try if you can please.

Install bash and edit the script to run with "bash" instead of sh, this should make it work again.

Turn the script back to "sh" and reboot, this should also make the script work again.
Ok. Here is what i got:
Code:
~ $ dpkg -l |grep bash
ii  bash3                                               3.2-0maemo10                              The GNU Bourne Again SHell branch 3.x, tuned

/opt/flopswap/script $ bash swapused.sh 
ublocks
swapused.sh: line 38: *512: syntax error: operand expected (error token is "*512")
ubytes
swapused.sh: line 41: /1024: syntax error: operand expected (error token is "/1024")
swapused.sh: line 42: /1024/1024: syntax error: operand expected (error token is "/1024/1024")
swapused.sh: line 43: /1024/1024/1024: syntax error: operand expected (error token is "/1024/1024/1024")
ukbytes, umbytes, ugbytes
767 swapsizembytes
0 lasttotalsmb
0 getcurrent
0 timeshundred
0 % Fresh Swap Written
This time the pop-up is showed when i run the script from terminal but isn't if i use the GUI instead. But the bigger problem is that the numbers showed are wrong. No matter how many times i try, it give me always that same output. I'll turn turn the script back to sh and reboot now.
Thanks a lot.

EDIT: wow Everything seens to be ok now both from terminal and from GUI. Thanks !
Code:
/opt/flopswap/script $ sh swapused.sh 
18136 ublocks
9285632 ubytes
9068 ukbytes, 8 umbytes, 0 ugbytes
767 swapsizembytes
0 lasttotalsmb
8 getcurrent
800 timeshundred
1 % Fresh Swap Written

Last edited by saponga; 2013-01-25 at 10:24.
 

The Following User Says Thank You to saponga For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#46
Originally Posted by sixwheeledbeast View Post
The issue is we are still going to eventualy end up at int32 overrun after a fair amount of uptime.
I am pretty sure this is int32 problem.
An signed int32 can hold a bit over 2GB (less than 2,3GB) as number of bytes. If you calculate bytes as blocks multiply 512, you will reach that border pretty soon.

So just change calculation as above (omit bytes and use directly kB or even MB) and you will be able to calculate up to 2TB swap space ...
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#47
Originally Posted by peterleinchen View Post
I am pretty sure this is int32 problem.
An signed int32 can hold a bit over 2GB (less than 2,3GB) as number of bytes. If you calculate bytes as blocks multiply 512, you will reach that border pretty soon.

So just change calculation as above (omit bytes and use directly kB or even MB) and you will be able to calculate up to 2TB swap space ...
I agree if a reboot fixed it this can only be the int32 issue.

As I explained here
http://talk.maemo.org/showthread.php?t=88121

I am now using Mb not bytes I am dividing the values by 1024.

I have not had this issue with my maximum 8 days of uptime time, so for a device with only 1 day of uptime that's a lot of swap.

I want FlopSwap to work indifinately not start failing after xyzTB of swap, so I am in search of another way.

PS thanks saponga for your testing.
As I say only had this issue with Ver 0.0.4beta when I was calculating swap by bytes. See link above for more information.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#48
Originally Posted by saponga View Post
Ok. Here is what i got:

This time the pop-up is showed when i run the script from terminal but isn't if i use the GUI instead. But the bigger problem is that the numbers showed are wrong. No matter how many times i try, it give me always that same output. I'll turn turn the script back to sh and reboot now.
@saponga
Just remembered I forgot to remind you that you have to change the shebang too. This is why the bash workaround failed.

Code:
##Replace bin/sh for bin/bash at the top of the script.
##Like...

#!/bin/bash

##Then run from terminal as "bash opt/... "


Let me know if you have any more trouble.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#49
Originally Posted by sixwheeledbeast View Post
I agree if a reboot fixed it this can only be the int32 issue.
Yep.

Originally Posted by sixwheeledbeast View Post
I am now using Mb not bytes I am dividing the values by 1024.
I hope we did not just talk but understood each other
What value are you dividing by 1024?
The number of bytes (ublocks * 512)? This would be bad idea.
The number of blocks (ublocks from /proc/diskstats? This would also be bad idea.
Just get the number of blocks and assign
let uMB=$(($ublocks / 2048))
this will assign the number of MBs (not rounded, so 1MB deviation possible).

Originally Posted by sixwheeledbeast View Post
I have not had this issue with my maximum 8 days of uptime time, so for a device with only 1 day of uptime that's a lot of swap.
Not so unusual. I get my swap space (now 2x 1,5GB filled up in one day with heavy browsing, mailing and a few more phone calls). So reaching 2GB after 1 day is possible.

One hint here for all swap checkers:
make your partition as big as you are willing to spent.
My swap usage is growing and growing. After 10 days I had more than 400MB swap usage. So with a default 768MB space a swaparound was triggered almost after a few hours and a few times a day.

Originally Posted by sixwheeledbeast View Post
I want FlopSwap to work indifinately not start failing after xyzTB of swap, so I am in search of another way.
Above will work. There will be no need for another solution.
TB=TeraByte, i.e. 1000GB
I do not think we will reach that amount of used swap. Even after a year uptime
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#50
Originally Posted by peterleinchen View Post
I hope we did not just talk but understood each other
What value are you dividing by 1024?
The easiest way is to post the code.
Can't get lost in translation then.
BTW thanks.

Code:
...snip...
#Get Swap size from /proc/swaps
swapsize=$(awk '{if ($1=="'"/dev/$disk"'") print $3}' /proc/swaps)
#Divide by 1024 to get swap size in megabytes
swapsizembytes=$(($swapsize/1024))
...snip...
Also the full source is there for anybody interested.

Originally Posted by peterleinchen View Post
Not so unusual. I get my swap space (now 2x 1,5GB filled up in one day with heavy browsing, mailing and a few more phone calls). So reaching 2GB after 1 day is possible.
I use my device heavily during work and only use my 800MB swap space in 4 days. It's possible due to "Swappolube" VM settings too.

Originally Posted by peterleinchen View Post
Above will work. There will be no need for another solution.
TB=TeraByte, i.e. 1000GB
I do not think we will reach that amount of used swap. Even after a year uptime
When/If someone gets to xyz uptime and it fails then this is a bug. No? I hate bugs however slight
Attached Files
File Type: gz script_FAO_peter.tar.gz (10.0 KB, 59 views)
File Type: gz full_source_flopswap.tar.gz (40.0 KB, 59 views)
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.
 
Reply


 
Forum Jump


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