The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
![]() |
2013-01-24
, 23:30
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#42
|
The Following User Says Thank You to peterleinchen For This Useful Post: | ||
![]() |
2013-01-24
, 23:35
|
Posts: 432 |
Thanked: 917 times |
Joined on Jun 2011
|
#43
|
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.
/opt/flopswap/script $ sh swapused.sh ublocks swapused.sh: line 38: arithmetic syntax error
The Following User Says Thank You to saponga For This Useful Post: | ||
![]() |
2013-01-24
, 23:38
|
Posts: 2,292 |
Thanked: 4,135 times |
Joined on Apr 2010
@ UK
|
#44
|
Hey sixwheeledbeast,
smells again like an int32 overrun of bytes.
Why you do not change like this
kbytes=$(($ublocks/2)) ?
The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
![]() |
2013-01-25
, 09:55
|
Posts: 432 |
Thanked: 917 times |
Joined on Jun 2011
|
#45
|
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.
~ $ 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
/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
The Following User Says Thank You to saponga For This Useful Post: | ||
![]() |
2013-01-25
, 12:58
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#46
|
The issue is we are still going to eventualy end up at int32 overrun after a fair amount of uptime.
![]() |
2013-01-25
, 20:04
|
Posts: 2,292 |
Thanked: 4,135 times |
Joined on Apr 2010
@ UK
|
#47
|
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 ...
The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
![]() |
2013-01-25
, 22:22
|
Posts: 2,292 |
Thanked: 4,135 times |
Joined on Apr 2010
@ UK
|
#48
|
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.
##Replace bin/sh for bin/bash at the top of the script. ##Like... #!/bin/bash ##Then run from terminal as "bash opt/... "
![]() |
2013-01-25
, 22:31
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#49
|
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.
The Following User Says Thank You to peterleinchen For This Useful Post: | ||
![]() |
2013-01-25
, 23:06
|
Posts: 2,292 |
Thanked: 4,135 times |
Joined on Apr 2010
@ UK
|
#50
|
I hope we did not just talk but understood each other
What value are you dividing by 1024?
...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...
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.
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
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.