1. 2015 is going to be a great year for Android! Why wait??
    Samsung Galaxy Note 5 | Samsung Galaxy S6 | HTC One M9
  2. New Forum Created: Samsung Gear VR!

Galaxo tweaks - get more memory :)


  1. kam187

    kam187 Well-Known Member

    # Remount read/write
    adb remount

    # open shell
    adb shell

    # go to apps directory
    cd /data/app_s

    # delete QuickDroid (if you want to)
    rm QuickDroid.apk

    # delete NPS sync (it doesn't work so why run it!)
    rm wssyncmlnps.apk

    # disable drexe (this gets baseband info for NPS. Who needs it!)
    mv /system/bin/drexe /system/bin/drexe.off

    # disable npsmobex (this handles auth with nps)
    mv /system/bin/npsmobex /system/bin/npsmobex.off

    Now kill any running apps, and flush the cache to get a good baseline of free memory:

    sync ; echo 3 > /proc/sys/vm/drop_caches ; cat /proc/meminfo ; free


    I get this Total memory after boot with all tasks killed:

    Code:
    MemTotal:        95948 kB
    MemFree:         23308 kB
    Buffers:            44 kB
    Cached:          15392 kB
    
    a total of (23308 + 15392)/1024 = 37.79296875

    You need to add the MemFree and Cached to get the total free memory usable by apps. This is the MAX memory you will have with no apps running (if u run the sync etc line above). The sync line above is usefull to compare the REAL memory change when you use various widgets or programs.

    Extra info..

    sync - flushes any disk caches

    echo 3 > /proc/sys/vm/drop_caches - Free pagecache, dentries and inodes:

    cat /proc/meminfo - Get memory and cache usage

    free - get memory usage

    Advertisement
    :
  2. kam187

    kam187 Well-Known Member

    If you don't use the SDK to take screenshots or debug then you can also kill debuggerd:

    mv /system/bin/debuggerd /system/bin/debuggerd.off

    Remember you can undo all the mv's by moving the .off file back to the original name :)

    Code:
    MemTotal:        95948 kB
    MemFree:         29268 kB
    Buffers:            44 kB
    Cached:          13728 kB
    
    
    Total memory = (29268 + 13728)/1024 = 41.98828125 mb

    My clean process list:

    Code:
      PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
    # my top command
     1594  1525 0        R     2064  2.1   0 14.2 top
     
    # ESSENTIAL PROCESS - core System process
     1085  1018 1000     S     158m169.1   0  0.0 system_server
     
    # ESSENTIAL PROCESS - android core process
     1129  1018 10000    S     122m130.1   0  0.0 android.process.acore
     
    # ESSENTIAL PROCESS - handles auto sync, and google connections
     1153  1018 10012    S     105m112.8   0  0.0 com.google.process.gapps
     
    # ESSENTIAL PROCESS - keyboard and locale
     1198  1018 10000    S     103m110.3   0  0.0 com.android.inputmethod.latin
     
    # ESSENTIAL PROCESS - handles phone functions
     1127  1018 1001     S     101m108.4   0  0.0 com.android.phone
     
    # ESSENTIAL PROCESS - handles android media (technically you could kill this 
                          but you'll cripple the phone media functions!)
     1245  1018 10013    S    93184 96.9   0  0.0 android.process.media
     
    # USEFULL PROCESS - Handles alarm clock and events.  You could kill it to 
                        save 1mb max, but its not really worth it.
     1285  1018 10059    S    92128 95.8   0  0.0 com.android.alarmclock
     
    # ESSENTIAL PROCESS - system process, handles forking requests
     1018     1 0        S    71300 74.2   0  0.0 zygote /bin/app_process -Xzygote /
     
    # ESSENTIAL PROCESS - Handles media player, camera etc.  Also the headset 
                          keys for music get intercepted by this process
     1019     1 1013     S    22696 23.6   0  0.0 /system/bin/mediaserver
     
    # ESSENTIAL PROCESS - API between OS and modem
     1017     1 1001     S     9568  9.9   0  0.0 /system/bin/rild
     
    # USEFULL PROCESS - Allows adb.  You could kill it, but you wouldnt be 
                        able to shell in anymore!
     1023     1 0        S     3332  3.4   0  0.0 /sbin/adbd
     
    # ESSENTIAL PROCESS - allows one to one comms between apps,
     1020     1 1002     S     1168  1.2   0  0.0 /system/bin/dbus-daemon --system -
     
    # ESSENTIAL PROCESS - handles disks
     1011     1 0        S      868  0.9   0  0.0 /system/bin/vold
     
    # ESSENTIAL PROCESS - handles running services
     1010     1 1000     S      808  0.8   0  0.0 /system/bin/servicemanager
     
    # ESSENTIAL PROCESS - handles apk installation and removal.  You need it 
                          if you use market!
     1021     1 0        S      800  0.8   0  0.0 /system/bin/installd
     
    # USEFULL PROCESS - handles auto rotate - uses very little memory anyway
     1013     1 0        S      256  0.2   0  0.0 /system/bin/akmd2
    
  3. Vap1d-

    Vap1d- Well-Known Member

    Thanks Kam, good stuff. Will have to do this on my other computer that has adb on it tomorrow.
  4. pegasus21

    pegasus21 Well-Known Member

    On a side note, do you notice if your phone stays awake more on this custom rom as opposed to official or maybe it's just something I installed recently

    During a 2hr period, my phone is running for about 6-7mins of the time. Trying to see what might have caused the running period.
  5. kam187

    kam187 Well-Known Member

    I havnt checked because i've been fiddling with the OS too much. Once i get this stable i'll have a look
  6. Andronix

    Andronix Well-Known Member

    Pegasus, yeah I noticed that also, try removing taskiller, it likes keeping the phone awake. I removed lot of things from original GalaxHero to know exactly wuat was the cause.

    Kam, thanks for that, very good info, as usual. :)
  7. kam187

    kam187 Well-Known Member

    ok so here's a quick script file to delete loads of unused stuff like diagnostics. Thanks Pegasus21 :)

    It deletes the HTC keyboard (not the default one that's used in galaxo or galaxoHero which is a skinned android one).

    It deletes Java and ext4 support. You can edit what it deletes if you want to keep them.

    It deletes galaxoapps, which lets face it is pretty useless after the first install :)

    It deletes NPS processes because we'll never update this ROM using NPS.

    It removes QuickDroid because it wastes CPU indexing. Install it from market again, or edit the file if u like it.

    It deletes the debuggerd process, if you use the SDK you might want to keep that. (adb will always work tho)

    To use, download the zip and put it into the same directory as adb. Then open a command prompt:

    # mount read/write
    adb remount

    # upload the script
    adb push clearapps.sh /system/clearapps.sh

    # Open a shell
    adb shell

    # make the script executable
    chmod +x /system/clearapps.sh

    # run the script
    /system/clearapps.sh

    # reboot
    reboot

    ----

    Then after you have rebooted, use taskkiller to kill any left over processes and you can check your ram with:

    sync ; echo 3 > /proc/sys/vm/drop_caches ; cat /proc/meminfo ; free

    Attached Files:

  8. kam187

    kam187 Well-Known Member

    Galaxo Hero:

    Code:
    MemTotal:        95948 kB
    MemFree:         29268 kB
    Buffers:            44 kB
    Cached:          13728 kB
    
    Total memory = (29268 + 13728)/1024 = 41.98828125 mb

    Galaxo:

    Code:
    MemTotal:        95948 kB
    MemFree:         20076 kB
    Buffers:            44 kB
    Cached:          27204 kB
    
    
    Total memory = (20076 + 27204)/1024 = 46.171875mb

    There's only about 5mb between them :-/
  9. pegasus21

    pegasus21 Well-Known Member

    Definitely not a task killer since I disabled it with pm just to see...
    Not handcent sms either...

    Quite odd but at least I managed to isolate the 4% drop in battery to a few items.
  10. Andronix

    Andronix Well-Known Member

    you may find usefull "autostarts".
  11. intouch

    intouch Member

    Mine is worse.
    With II5 firmware, my Galaxy is running for about 12 mins in a 1hr period!
    I thought it was normal.
    I have WiFi and 3g data enabled. No third-parties applications installed.
  12. Andronix

    Andronix Well-Known Member

    Uh, I'd suggest factory reset and monitor things for a bit.
  13. Rastaman-FB

    Rastaman-FB Well-Known Member

    Are you using the case
  14. kam187

    kam187 Well-Known Member

    Experimenting with stock II5 now... stay tuned...

    MemTotal: 95976 kB
    MemFree: 30788 kB
    Buffers: 44 kB
    Cached: 22452 kB

    Total 51.992mb

    Seems pretty stable at just over 50mb free :)
  15. intouch

    intouch Member

  16. boomtopper

    boomtopper Active Member

    Hi Kam have you done a script aswell for cleaning up the stock II5?
  17. hippy

    hippy Well-Known Member

    The script posted by kam187. I know some of these items are self-explanatory, but before I remove them any chance you could explain some of the odd ones in case I actually want to keep them? eg. would I ever use debuggerd? DebugTool.apk? What's Jbed.apk? Is LogCollector useful? No need for FTP client or VPB connections? What's bootsetttings? Why remove camerafirmware? CSC? CurrentDataState? You get the idea :)

    I'm just wondering what a lot of this does and why you would choose to remove it (obv. forgetting the memory bonus).

    Thanks!

  18. shanyel

    shanyel Active Member

    can someone get here the Samsung Switchers.apk? mistakenly i deleted it
    thanks,
  19. kam187

    kam187 Well-Known Member

    Stock script i just did quickly. I just changed the directorys etc.

    You'll get some file not found stuff because i didnt remove all the lines for files that are only in the Galaxo Hero rom :)

    You'll probably need busybox. Install the custom recovery if u dont have it already and 'enable su'.

    Then boot into normal mode and copy busbox and the script to your sdcard. Then adb shell

    # superuser (superuser.apk will load on the phone, allow it)
    su

    # remount system read/write
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock1 /system

    # copy busy box
    cat /sdcard/busybox > /system/bin/busybox

    # change permisions
    chmod 4755 /system/bin/busybox

    # install busy box
    /system/bin/busybox --install -s /system/bin/

    # fix cp
    cd /system/bin
    busybox cp -s busybox cp

    # copy script to system (there's no +x on the sdcard)
    cp /sdcard/clearappsstock.sh /system
    chmod 744 /system/clearappsstock.sh

    # run it, and ignore the file not found stuff
    /system/clearappsstock.sh

    Then reboot, adb shell back in, su and type ps and look for the debuggerd process. If its not there everything went ok :)


    Hippy:

    debuggerd - Its only used if you develop apps with the SDK. You won't need it. If you do develop apps you'll probably need to restore to factory and make sure you're stuff works on a stock phone anyway.

    DebugTool.apk - its some debug menu u can bring up. You'll never use it!

    Jbed.apk - Java. I dont need or use it. You can keep it if you want :)

    LogCollector - Used to collect crash logs etc. You dont really care about crashlogs :)

    bootsetttings - switches boot settings i think. Once the firmware has booted first time it wont be used again

    camerafirmware - used to update the camera firmware. Pretty dangerous (see the other thread). After first boot you'll never use this again.

    CSC - CSC inits for first boot. Not used again

    CurrentDataState - I forget what this one is tbh!

    MEGAUPLOAD - The leading online storage and file delivery service
  20. Andronix

    Andronix Well-Known Member

    I ran your script and changed compcache settings to 64000 so compcache can use all free RAM. It works quite well sofar. Browser now rarely clean open tabs and phone is not crawling after some time. Try it...
  21. drakaz

    drakaz Member

    And another great job from kam187 !! :)

    Currently working on a light version of the rom (the new Galaxo), with this kind of purification, a lightest kernel and a few init.rc tunning. I hope this futur rom will be fastest. kam187, if you have another improvment...
  22. skandalfo

    skandalfo Active Member

    Please don't remove development facilities from your roms.

    I actually love GalaxoHero, but it would be a hassle having to search and re-install the debugging features after a rom installation / upgrade. Debugging in the device is much better than using the emulator (at least for me). It's better leaving the option to enable it in (if that's not what the "Settings / Applications / Development / USB Debugging" option does).

    One thing is removing items that don't work at all and that you can't disable (NPS sync thingies), and another one is removing things that actually work.
  23. kam187

    kam187 Well-Known Member

    USB debugging enables adb.

    The device itself runs adbd and debuggerd, these are different processes for different purposed. adbd handles adb shell etc, so is usefull to keep running. Otherwise you'll be really stuck if something broke!

    debuggerd is used by the SDK debugger. It shows debug information for your test process. Unless you're developing apps you dont need it. And if you do one day, just adb in and rename it from debuggerd.off back to debuggerd

    If you're developing apps you should be running a stock system anyway!

    so debuggerd is useless for most users, and those that need it should know not to run that line :)
  24. hippy

    hippy Well-Known Member

    Surely it's better to distribute the lightest ROM and leave it up to users to install stuff?

    Also, there's going to be far fewer users that needing development tools than not, so it makes sense to remove them and let users that need them add them later.
  25. scollie

    scollie Active Member

    Kam in post #7 you included a script clearapps.zip which deletes files from
    /data/app_s.

    Then in post #19 you included a link to a MEGAUPLOAD file clearappsstock.zip which deletes files from
    /system/app

    So I am now a bit confused, should I run one or both of these scripts?

    Also in #19 you have the following lines
    cp /sdcard/clearappsstock.sh /system
    chmod 744 /system/clearapps.sh

    # run it, and ignore the file not found stuff
    /system/clearapps.sh

    which seem to copy the appsstock file but executes the apps one, is there a typo here?
Loading...

Share This Page