PE 5.02 memory fix? - I think so!

Discussion in 'Project Elite' started by nuguy, Apr 3, 2011.

  1. nuguy
    Offline

    nuguy New Member

    Joined:
    Jan 10, 2010
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    0
    PE 5.02 memory fix? - I think so! (well getting there anyway)

    <edit>

    So, there has been some headway on this and just to let you all know:

    a) I do *not* lay claim to the actual work here.
    b) I have been running around all over the net trying to learn/resolve some of the memory issues
    c) I just want to share where I am now - so others can learn/help

    most of the good stuff is imoseyon in action, and the rest will hopefully be added into the final imoseyon zip for the D1...

    So, what I am really doing at this point is:

    Using a d1
    Raid zero recovery latest
    Rz ulv 125-1100
    Running Project Elite 5.02 (gingerbread)
    aprox 100 apps installed - most on the card

    I have installed sysctl and enabled sysctl support
    I have installed all 3 imoseyon zips (6.2.1, d1.3, d1.6) running .6 @ the moment (don't forget to reboot after initial boot)
    I have run the enable swap scripts in each of them - but I don't think it is running currently

    Through pe options (in the rom settings like on cm):
    Set vm to 45m
    Compcache off
    Cpu min 125
    Cpu max 1100
    Governer ondemand (I liked interactive better but this is working)

    Ok, so at this point it's working fairly well, but...
    I keep having apps start 'restarting' especially maps - draining the battery and stopping me from getting updates cause then other things start crashing too...

    So...

    If I then enable the sd speed up hack (sd increase - free market ap) with 3072k (set every boot - check)

    And run the following in gscripts with su
    echo "1280,1792,5120,6656,7182,7680" > /sys/module/lowmemorykiller/parameters/minfree
    vm.swappiness = 0 vm.min_free_kbytes = 2048 vm.dirty_ratio = 90 vm.dirty_background_ratio = 70 vm.oom_kill_allocating_task = 1 vm.vfs_cache_pressure = 1 vm.laptop_mode = 1 net.core.rmem_default = 524288 net.core.rmem_max= 542488 net.core.wmem_default = 542488 net.core.wmem_max= 542488 net.ipv4.tcp_timestamps = 0 net es.ipv4.tcp_fack = 0 net.ipv4.tcp_sack = 0 net.ipv4.tcp_fin_timeout = 15 net.ipv4.tcp_keepalive_intvl = 30 net.ipv4.tcp_keepalive_probes = 5 net.ipv4.tcp_tw_recycle = 5 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_keepalive_time = 1800 net.ipv4.ipfrag_high_thresh = 512000 net.ipv4.ipfrag_low_thresh = 446464 net.ipv4.tcp_max_tw_buckets = 360000 net.core.optmem_max = 57344

    I also used auto memory manager to adjust oom settings of a few key apps as well

    Now the *ish flies! and much less aps "restarting" - I do still go in and end maps and the bluetooth processes as they seem to still help with stability

    I am pretty sure anyone who tries the updated memory values from above will be happier!! - listed again here for emphasis - run the following in gscripts with su
    echo "1280,1792,5120,6656,7182,7680" > /sys/module/lowmemorykiller/parameters/minfree


    But I am sure this would be better through the scripts so I don't have to run it all after boot and it gets set at a more core level (init.d).

    There may be something you see that should be changed/added/removed/otherwise tweaked as well.

    I would love to know what you all think at this point?

    Thanks,
    Mike

    </edit>
    imoseyon

    Has anyone else tried the hack zip put together by imoseyon? They were done for the X and d2, but they have made my d1 with pe5.02 absolutely rock!

    The following is the thread I found the imoseyon link in, there is a lot of discussion there with troubleshooting and additional tweaks:

    http://www.droidforums.net/forum/li...ou-guide-better-preformance-battery-life.html

    Can some others test and chime in, I think this is what we needed to fix the gb memory issues!

    ping to other resources for this project:
    imoseyon
    http://cl.ly/1t3f2W0W3h180z2N3s08 (link to .6 dl by imoseyon)
    [GScript v5] SuperCharge & Bulletproof Your Milestone & Droid ! Now STOCK ROMS Too!! - xda-developers
    ongoing:android_myths [CVPCS Android Wiki]
    http://www.droidforums.net/forum/droid-applications/65483-task-killers-answer-google-developers.html
    http://www.droidforums.net/forum/project-elite/138986-pe-5-02-memory-fix-part-ii.html
    http://www.droidforums.net/forum/project-elite/139786-sd-hack.html
    there are a couple more I need to add...
    Last edited: Apr 12, 2011
  2. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I'm going to check this out now and report back. Do you still find yourself needing to lock apps in memory or does that seem unnecessary for the most part?
  3. nuguy
    Offline

    nuguy New Member

    Joined:
    Jan 10, 2010
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    0
    I haven't unlocked texts yet (kind of critical) I am only on a couple of hours so far, but the way it is performing, is making me feel brave!
  4. pronghornrunner
    Offline

    pronghornrunner New Member

    Joined:
    Jan 24, 2011
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mountains
    Interesting. It takes a pair to flash a zip not designed for your phone... seriously! I'll keep looking for other's feedback. But, I can't say I'm going to go ahead and flash a DX/D2 zip that will alter my D1's function...
  5. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I wouldn't say "it takes a pair." It just takes people who are accepting of risk. I'm not worried about it. I read the site, examined the concept, and I looked at the scripts contained in the update.zip. It's not doing anything DX/D2 specific. I may be new around these forums, but I know what I'm doing. Truthfully, the concept is sound and not really dangerous--it can be undone by modifying the scripts to change things back to normal--or one could just re-flash the PE rom. Plus, I have a spare D1 that I'm ok to fry and brick in the name of testing. I decided I want to check into something that might help the community and I'm pressing forward. I'll report back in a few days to note how things worked out.
  6. natezire71
    Offline

    natezire71 New Member

    Joined:
    Mar 12, 2010
    Messages:
    287
    Likes Received:
    4
    Trophy Points:
    0
    Location:
    Atlanta
    Which post is it on his Blog?
  7. jengas kahn
    Offline

    jengas kahn New Member

    Joined:
    Feb 26, 2011
    Messages:
    259
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    upstate
    i tried to one in the first post, v6.2.1. said it installed, but didn't seem to do anything. running what's in my signature.
  8. gunit34328
    Offline

    gunit34328 New Member

    Joined:
    May 26, 2010
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    0
    how do you know if you're running a kernel that supports swap? the kernel im using is a chevyno1 kernel (2.6.32-lowV-1.1Ghz-ChevyNo1).
    Last edited: Apr 3, 2011
  9. racketier
    Offline

    racketier New Member

    Joined:
    Feb 27, 2010
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    0
    What steps did you take and what settings are you using?

    Did you just flash the zip and that was it?


    Update: I flashed the zip and opened a terminal and ran "bash /data/imoseyon/checkimosey.sh" to check to see if it was working. It said nothing is enabled, and I wasn't able to enable anything. I'm using CM7 RC4 with Prime's deprimed kernel, so that may be why.
    Last edited: Apr 4, 2011
  10. nuguy
    Offline

    nuguy New Member

    Joined:
    Jan 10, 2010
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    0
    Updated OP with more info...

    Been running this for about 24 hours now, and while it's not "perfect" this is the best my d1 has run gingerbread! Perhaps we can come up with a more fine tuned version...

    Driving Directions has not reset my phone.
    Market updates software the first time.
    -still if I don't close some "running services" like maps I will get some apis that go into the "restarting" mode (which seems to be when I have the most issues) but that has only happened once, I would have had that several times by now...

    Overall, the entire device is snappier, and more fluid.

    Oh, and my battery send to be way more accurate, it drains slower, and does not show as charged after only charging for 15-20 minutes..

    I am running pe5.02 with rzrecovry and rz's newest mid voltage 125-1100 kernel, I don't know if it matters, but I already had sysctl installed, but before I loaded the zip I made sysctl active, and cleared my dalvik, battery, and cash from rzrecovry, as well, I had run fix permissions in rom manager for good measure.
    Last edited: Apr 4, 2011
  11. racketier
    Offline

    racketier New Member

    Joined:
    Feb 27, 2010
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    0
    I installed a raidzero kernel and flashed the zip again, but still dont see any results. I then installed sysctl from the market, enabled it, reflashed, and still nothing.


    I think I should be seeing a 99imoseyo file in my /etc/init.d/ but it's not there. Any ideas?
  12. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Make sure you enable sysctl after you install the zip. You can grab something like Sysctl Config Root to enable it with ease at https://market.android.com/details?id=com.jrummy.sysctl.config
  13. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I haven't had much time to play with this, but I have a little bit to report. The file mostly runs a series of scripts originally created for the D2/DX. The bulk of the script operations involves familiar concepts to the custom rom crowd: zipalign apks, change minfree settings, tweaks CPU sampling rates, and some other things. I ended up editing the script a bit to remove some D2/DX items. The file is called 99imoseyon found in /system/etc/init.d

    I kept a lot of the script the same (disable logging, cron features, etc). I altered the minfree settings to use the values reported at http://www.droidforums.net/forum/pr...lite-v5-gingerbread-aosp-102.html#post1376206. I also removed some of the CPU frequency/overclocking items and I enabled zipalign. At the end of the script, you'll see imoseyon's swap code. I think this is what's giving some people a good level of success. He's turning on a swap file using the device's internal storage memory. I still need to play with things a bit more. Here's the revised script I'm using:

    Code:
    #!/system/bin/sh
    # imoseyon mods
    
    # disable logger - performance boost & save memory (hopefully)
    rm /dev/log/main
    
    # aggressive memory management (may need more tweaks)
    echo "2048,3072,6144,7168,8192,8192" > /sys/module/lowmemorykiller/parameters/minfree
    
    # sysctl tweaks
    sysctl -p /data/imoseyon/sysctl.conf
    
    # zipalign system if necessary
    sh /data/imoseyon/zipalign_system.sh
    
    # enable crond
    # crond calls getpwnam (user database search)
    mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
    echo "root:x:0:0::/data/cron:/system/bin/bash" > /etc/passwd
    mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
    # crond has "/bin/sh" hardcoded
    mount -o remount,rw rootfs /
    ln -s /system/bin/ /bin
    if [ ! -d /tmp ]; then
      mkdir /tmp
      mount -t tmpfs tmpfs /tmp
    fi
    mount -o remount,ro rootfs /
    /system/xbin/startcron.sh
    
    # clean-up - needed for some ROMs
    pkill /system/bin/telnetd
    mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
    rm /system/bin/pgrep
    rm /system/bin/telnetd
    rm /system/bin/crond
    mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
    
    
    # sleep a while and then start killing annoying processes registered to zygote
    # sleep 10
    #sh /data/imoseyon/killapps.sh
    
    # if swapfile exists, enable swap and adjust other settings
    if [ -f /data/imoseyon/swap ]; then
      swapon /data/imoseyon/swap
      echo "100,200,20000,20000,20000,25000" > /sys/module/lowmemorykiller/parameters/minfree
      sysctl -w vm.swappiness=40
    fi
  14. racketier
    Offline

    racketier New Member

    Joined:
    Feb 27, 2010
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    0
    I still can't figure out why I don't have any new files in /system/etc/init.d after flashing imoseyn's zip file. So I took your script above and used notepad++ to save it as a file with no extension, and stuck it in /system/etc/init.d and rebooted. I'm not sure if it's doing anything, but hopefully it is and I'll notice some improvements.

    Are you also using compcache? I currently have it disabled.
  15. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    You don't need compcache, but what you did isn't going to work. You'll need to alter the zip and reinstall with my script. I'll put a new version up tonight, hopefully. In the meantime, make sure you aren't running any other swaps and that compcache is disabled. Then run the free command in terminal to see if you have any sort of swap working. If so, at least the script loaded the swap file on the phone's internal memory. I'll also have to look at how I have this phone setup to see what might be different from the norm. I've really hacked the hell out of my D1 and I'm not sure what else could be causing the script to work properly.
  16. racketier
    Offline

    racketier New Member

    Joined:
    Feb 27, 2010
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    0
    I ran the "free" command, and swap says 0 across the board.

    Also, I have a bunch of files in data/imoseyon...but I didn't see anything in system/etc/init.d (except the script I manually moved there)


    If you could put the changes together in a new flashable zip I'll test it out. Thanks!
    Last edited: Apr 5, 2011
  17. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Hmm... something isn't creating the swap. I'll do a full on reset of my phone tonight and start from scratch to see what happens. It also sounds like the script isn't creating the cron entry. We can trade our findings later and figure it out.
  18. fused2explode
    Offline

    fused2explode New Member

    Joined:
    Nov 9, 2010
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    0
    Swap is a partition... search swap partition in forums, I would look at cyanogen's forums.

    You can't "enable" swap unless you've partitioned your sdcard for it. I don't know if Project Elite even supports the filesystem structures needed to use swap (extfs3/4). Honestly CM7 with a swap partition was the best my phone has ever ran GB. I'm going back unless PE actually does support it. Its one of CM7's best features, although not many take advantage of it. Cyanogen does tho :)

    F2E
    Sent from my Droid using Tapatalk
  19. fused2explode
    Offline

    fused2explode New Member

    Joined:
    Nov 9, 2010
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    0
  20. jonny6pak
    Offline

    jonny6pak New Member

    Joined:
    Jun 1, 2010
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for posting that. It made me look at some things I had setup on my Droid. I've had my card formatted for swap long before I moved to PE and I seem to now have swap running off that partition (I turned that off a while ago). I'm most certainly going to start everything from scratch to monitor what goes on. CM7's swap support and its ability to purge assets is really great and solves a lot of the memory issues. I would love to see PE support purging assets. Now I wonder if PE is able to support the swap. I've never really considered it because I haven't used a swap in a very long time. I want to see this work with a swap on the internal memory per imoseyon's intentions... hopefully I see a ray of light tonight.
Search tags for this page

android net.ipv4.udp mem

,
net.ipv4.udp mem android