Page 124 of 145 FirstFirst ... 2474114119120121122123124125126127128129134 ... LastLast
Results 2,461 to 2,480 of 2889
Like Tree17Likes
  1. #2461  
    Quote Originally Posted by Xamil View Post
    reboot, reboot, reboot... no, it's Windows way better method: check occupancy rate of the swap when device go to sleep (to avoid problems when pre in use) and clean it if it reach limit (for example, 70Mb). yes, it's a kludge but works well =)
    Code:
    #!/bin/sh
    limit=71680 #70Mb
    
    tail -f /var/log/messages \
      | awk '/screenstate: lcd off/ { print; fflush() }' \
      | while read; do
    	swap_used_space="$(swapon -s | grep store-swap | awk '{ print $4 }')"
    	if [ "$swap_used_space" -gt "$limit" ]
    	then
    		#echo "$swap_used_space is bigger than $limit"
    		swapoff -a && swapon -p 1 /dev/mapper/store-swap
    	fi
      done
    So do I just punch this in Novaterm and poof, my swap cache just flushes when I hit 70Mb and I turn off the screen? I've been looking for an easy way to do this instead of opening govnah and toggling compressed swap on and off.

    And +1 on the picture thing. Even when I move them with Internelz still can't see.
    Last edited by Delgarth; 04/18/2011 at 07:44 AM.
  2. #2462  
    Quote Originally Posted by Delgarth View Post
    So do I just punch this in Novaterm and poof, my swap cache just flushes when I hit 70Mb and I turn off the screen?
    to use this code, you must first write it to the file (for example, /etc/init.d/swapcleanup.sh) and set executable bit to a file (chmod +x /etc/init.d/swapcleanup.sh). to this script run automatically when you boot the smartphone you can use the UpStart service. You should create a file /etc/event.d/swapcleanup and write into it this code:
    Code:
    # -*- mode: shell-script; -*-
    start on stopped swaphack
    console output
    exec /etc/init.d/swapcleanup.sh
    here's the corrected code of script (now uses a message from the powerd about disabling the touchscreen (for a few seconds before device goes to sleep))
    Code:
    #!/bin/sh
    limit=71680
    
    tail -f /var/log/messages \
      | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
      | while read -r line; do
    	swap_used_space="$(swapon -s | grep store-swap | awk '{ print $4 }')"
    	if [ "$swap_used_space" -gt "$limit" ]
    	then
    		#echo "$swap_used_space is bigger than $limit"
    		swapoff -a && swapon -p 1 /dev/mapper/store-swap
    	fi
      done
    and i recommend to reduce the limit from 70 to 50Mb (variable limit in code, line 2)
    Sorry for my English =)
  3. #2463  
    Quote Originally Posted by Xamil View Post
    to use this code, you must first write it to the file (for example, /etc/init.d/swapcleanup.sh) and set executable bit to a file (chmod +x /etc/init.d/swapcleanup.sh). to this script run automatically when you boot the smartphone you can use the UpStart service. You should create a file /etc/event.d/swapcleanup and write into it this code:
    Code:
    # -*- mode: shell-script; -*-
    start on stopped swaphack
    console output
    exec /etc/init.d/swapcleanup.sh
    here's the corrected code of script (now uses a message from the powerd about disabling the touchscreen (for a few seconds before device goes to sleep))
    Code:
    #!/bin/sh
    limit=71680
    
    tail -f /var/log/messages \
      | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
      | while read -r line; do
    	swap_used_space="$(swapon -s | grep store-swap | awk '{ print $4 }')"
    	if [ "$swap_used_space" -gt "$limit" ]
    	then
    		#echo "$swap_used_space is bigger than $limit"
    		swapoff -a && swapon -p 1 /dev/mapper/store-swap
    	fi
      done
    and i recommend to reduce the limit from 70 to 50Mb (variable limit in code, line 2)
    I didn't think you'd mind, i've written this up in easy to execute steps over here: http://forums.precentral.net/showthread.php?p=2948034.
  4. #2464  
    [QUOTE=NickVTPre;2948038]I didn't think you'd mind, i've written this up in easy to execute steps over here: [URL]

    I have tried this and it doesn't seem to be working as described. Still in excess of 60+ even though its set to clear at 50. I am running f104, is this only usable for uberkernal?
    What does this button do?


    crappy phones -->treo 600--> 700p--> 755p--> Pre--->Pre- 2.1 F104-----Franken Pre+ 2.1 f105 ---> Franken pre2 2.2.4
    touchpad 16gig uberkernel woop woop!!!
  5. #2465  
    Quote Originally Posted by loopytee View Post
    I have tried this and it doesn't seem to be working as described. Still in excess of 60+ even though its set to clear at 50. I am running f104, is this only usable for uberkernal?
    kernel

    What have you actually typed as your "limit"?


    M.
  6. #2466  
    I followed the directions and used the files found here.

    clearing the swap memory - PreCentral Forums

    it is my understanding that it is set to 50
  7. #2467  
    kernel, roger that, thats a big 10-4, woops
  8. #2468  
    Quote Originally Posted by Xanadu73 View Post
    kernel

    What have you actually typed as your "limit"?


    M.
    I set the limit to 50*1024 or 51200. Check that thread for the files.
  9. #2469  
    Quote Originally Posted by NickVTPre View Post
    I set the limit to 50*1024 or 51200. Check that thread for the files.
    It's not you guys. The Script is wrong. First the corrected version:

    Code:
    #!/bin/sh
    #limit=71680
    limit=53248
    
    tail -f /var/log/messages \
            | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
            | while read -r line; do
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo $swap_used_space
                    if [ "$swap_used_space" -gt "$limit" ] ; then
                            #echo "$swap_used_space is bigger than $limit"
                            swapoff -a && swapon -p 1 /dev/mapper/store-swap
                    fi
            done
    Now: "Why was the other one wrong?"

    Because:

    Code:
    root@My Pre:/etc/event.d# swapon -s
    Filename            Type            Size    Used    Priority
    /dev/ramzswap0      partition       106488  47560   0
    Which means "grep store-swap" (from the original) *NEVER* matches because that string doesn't exist in the above output therefore swap is *NEVER* emptied because $swap_used_space is *NEVER* greater than $limit because $swap_used_space is an null and not a value.

    Sprint Pre Minus, webOS 2.1


    M.
  10. #2470  
    Quote Originally Posted by Xanadu73 View Post
    It's not you guys. The Script is wrong. First the corrected version:

    Code:
    #!/bin/sh
    #limit=71680
    limit=53248
    
    tail -f /var/log/messages \
            | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
            | while read -r line; do
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo $swap_used_space
                    if [ "$swap_used_space" -gt "$limit" ] ; then
                            #echo "$swap_used_space is bigger than $limit"
                            swapoff -a && swapon -p 1 /dev/mapper/store-swap
                    fi
            done
    Now: "Why was the other one wrong?"

    Because:

    Code:
    root@My Pre:/etc/event.d# swapon -s
    Filename            Type            Size    Used    Priority
    /dev/ramzswap0      partition       106488  47560   0
    Which means "grep store-swap" (from the original) *NEVER* matches because that string doesn't exist in the above output therefore swap is *NEVER* emptied because $swap_used_space is *NEVER* greater than $limit because $swap_used_space is an null and not a value.

    Sprint Pre Minus, webOS 2.1


    M.
    Many thanks, Xanadu73! My unix command knowledge grows daily. I'll package this up and drop it over on the thread where folks are testing this to see if it will work.
  11. snpalavan's Avatar
    Posts
    71 Posts
    Global Posts
    72 Global Posts
    #2471  
    [QUOTE=loopytee;2948491]
    Quote Originally Posted by NickVTPre View Post
    I didn't think you'd mind, i've written this up in easy to execute steps over here: [URL]

    I have tried this and it doesn't seem to be working as described. Still in excess of 60+ even though its set to clear at 50. I am running f104, is this only usable for uberkernal?
    This works/doesn't work regardless of the kernel running because it only deals with the swap file (unless for some reason that kernel lacks support for a swap file).
  12. #2472  
    Running uberkernel on an AT&T Pre Plus, webOS 2.1.

    I had been using a custom profile - 400/800 screenstate, created in Govnah.

    1.) Using the phone caused the screen to lock up, requiring a re-set every single time I used the phone.

    2.) Govnah showed the CPU dropping to 250hz when the screen was off (not the 400 I had set it for).

    After systematically removing all of my patches, it wasn't until I thought to switch to an UK preset - 500/800 screenstate, that these problems went away.

    Thoughts?

    Thanks,
    -bc
  13. #2473  
    Quote Originally Posted by cellobrian View Post
    Running uberkernel on an AT&T Pre Plus, webOS 2.1.

    I had been using a custom profile - 400/800 screenstate, created in Govnah.

    1.) Using the phone caused the screen to lock up, requiring a re-set every single time I used the phone.

    2.) Govnah showed the CPU dropping to 250hz when the screen was off (not the 400 I had set it for).

    After systematically removing all of my patches, it wasn't until I thought to switch to an UK preset - 500/800 screenstate, that these problems went away.

    Thoughts?

    Thanks,
    -bc


    Where did you get 400 from? You would have had to go way out of your way to try to use 400. Hence why it went to 250.
    Live free or DIE!
  14. #2474  
    Quote Originally Posted by cellobrian View Post
    I had been using a custom profile - 400/800 screenstate, created in Govnah.

    1. Govnah --> App-Menu --> Preferences
    2. Manual Entry: TURN IT OFF


    NOW setup your profile.


    M.
  15.    #2475  
    Quote Originally Posted by cellobrian View Post
    Running uberkernel on an AT&T Pre Plus, webOS 2.1.

    I had been using a custom profile - 400/800 screenstate, created in Govnah.

    1.) Using the phone caused the screen to lock up, requiring a re-set every single time I used the phone.

    2.) Govnah showed the CPU dropping to 250hz when the screen was off (not the 400 I had set it for).

    After systematically removing all of my patches, it wasn't until I thought to switch to an UK preset - 500/800 screenstate, that these problems went away.

    Thoughts?

    Thanks,
    -bc
    First, turn off manual settings. You should never use them.

    Your device is flakey cause you are telling it to run at 250, and many devices don't handle that, hence it's not a predefined profile.

    There are no bugs here, except perhaps me not stopping people using manual settings.

    -- Rod
  16. #2476  
    Quote Originally Posted by NickVTPre View Post
    Many thanks, Xanadu73! My unix command knowledge grows daily. I'll package this up and drop it over on the thread where folks are testing this to see if it will work.
    Actually, that still won't do anything. Turning the swap back on wasn't right either.

    Code:
    #!/bin/sh
    #limit=71680
    limit=53248
    
    tail -f /var/log/messages \
            | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
            | while read -r line; do
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo $swap_used_space
                    if [ "$swap_used_space" -gt "$limit" ] ; then
                            #echo "$swap_used_space is bigger than $limit"
                            swapoff -a
                            swapon /dev/ramzswap0 -p 100
                    fi
            done
    I guess the original was written for 1.4.5? I dunno. I don't have 1.4.5 handy to test.


    M.
    Last edited by Xanadu73; 04/30/2011 at 06:47 PM.
  17. #2477  
    Quote Originally Posted by Xanadu73 View Post
    Actually, that still won't do anything. Turning the swap back on wasn't right either.

    Code:
    #!/bin/sh
    #limit=71680
    limit=53248
    
    tail -f /var/log/messages \
            | awk '/hidd: DisableTouchpanel/ { print; fflush() }' \
            | while read -r line; do
                    swap_used_space=$(swapon -s | grep swap | awk '{ print $4 }')
                    #echo $swap_used_space
                    if [ "$swap_used_space" -gt "$limit" ] ; then
                            #echo "$swap_used_space is bigger than $limit"
                            swapoff -a
                            swapon /dev/ramzswap0 -p 100
                    fi
            done
    I guess the original was written for 1.4.5? I dunno. I don't have 1.4.5 handy to test.


    M.
    At least one person reported that what you posted earlier did work when run from SDL terminal...
    Do you know the difference between when it reports the partition as "/dev/ramzswap" vs. "/dev/mapper/store-swap"? I thought one was with compcache disabled and one with it enabled. I think the "/dev/mapper/store-swap" is with it enabled. I had used "swapon -v -p 1 /dev/mapper/store-swap" to turn it back on, which seemed to work just fine.
  18. snpalavan's Avatar
    Posts
    71 Posts
    Global Posts
    72 Global Posts
    #2478  
    ok i played around a little more, seems that there still is a problem:

    so if i run "swapoff -a" then "swapon /dev/ramzswap0 -p 100" from SDL terminal independently, they work fine.
    free -tm shows:
    0/0/0 for swap total/used/free (after running swapoff)
    103/0/103 for swap total/used/free (after running swapon)

    So as far as the ACTUAL COMMANDS, they work. Now, when using the .sh file, i first assumed that it worked correctly, but dug a little deeper. Apparently it DOES succeed at erasing the swap. I watched in Govnah, and the swap size slowly decreased down to 0 from 60. However, this 'continued' for a while longer (technically attempting to reduce the swap to less than 0. The swap was never turned back on. I looked at the SDL terminal and notice it said 'bad number' or something to that effect. Basically, this was telling me that the swap was slowly being eaten away and once it got to 0 there was nothing to tell it to stop and kept going which only gave errors. Because of this, the swapon command never was run.

    My thoughts is that the if statement is not functioning correctly, perhaps don't check if the used is less than the limit. Instead, for testing purposes, set a separate if to check if the swap size is 0 and if YES then run the swapon. That way, once the swap reaches 0 no other command is run and the swap is turned on. Also, maybe there needs to be a break from the while loop because it is running infinitely.

    I hope all of that makes sense! haha

    Additionally, i noticed the swap size is created as "100mb". I'm not sure if this is related to the size set in Govnah, but i would like to have my limit be the one set there, (which also confuses me since i set it to "32mb" yet my swap always goes higher. Anyway if someone could set me straight on why this is, it would be much appreciated!
  19. #2479  
    Quote Originally Posted by snpalavan View Post
    Additionally, i noticed the swap size is created as "100mb".
    swapon --help


    M.
  20. #2480  
    Quote Originally Posted by snpalavan View Post
    ok i played around a little more, seems that there still is a problem
    And, yes, there is. Give me just a bit longer. I have a final version coming.


    M.

Tags for this Thread

Posting Permissions