CM11 Random Reboot Fix - Droid X Android Development

I got fed up with CM11's constant reboots and did some digging, and discovered what was causing it. Kitkat by default uses zram, which increases CPU overhead, makes it painfully slow, and apparently on the DX, makes it unstable. I disabled it and made a swapfile in /data, a day and a half of heavy tinkering later, not one crash, and it's rather snappy for being on a 5 year old device. I even installed a ****load of Xposed modules and overclocked. Not one crash.
The fix:
Use either ES or CM File Manager to make an init.d script with the following content:
Code:
#!/system/bin/sh
swapoff /dev/block/zram0
You want this done early, so name it "07-zramoff" or something. Set proper perms and you're done. It doesn't make a big difference as far as RAM usage goes (maybe 10MB), but if you're really worried about it, make a swapfile and an init.d script to swapon at boot.
Note: If you have the Gapps installed, your DX will still be painfully slow.
As always, thanks to the devs for keeping our old DXs useful.

argentwarrior20 said:
I got fed up with CM11's constant reboots and did some digging, and discovered what was causing it. Kitkat by default uses zram, which increases CPU overhead, makes it painfully slow, and apparently on the DX, makes it unstable. I disabled it and made a swapfile in /data, a day and a half of heavy tinkering later, not one crash, and it's rather snappy for being on a 5 year old device. I even installed a ****load of Xposed modules and overclocked. Not one crash.
The fix:
Use either ES or CM File Manager to make an init.d script with the following content:
Code:
#!/system/bin/sh
swapoff /dev/block/zram0
You want this done early, so name it "07-zramoff" or something. Set proper perms and you're done. It doesn't make a big difference as far as RAM usage goes (maybe 10MB), but if you're really worried about it, make a swapfile and an init.d script to swapon at boot.
Note: If you have the Gapps installed, your DX will still be painfully slow.
As always, thanks to the devs for keeping our old DXs useful.
Click to expand...
Click to collapse
Lol my sister's phone broke so I was about to cook up an update for cm11-Kanged so she can run the droidx till she gets a better replacement, I'll try this and see how it goes, with gapps of course (my ROM includes them)

can you please give more detail?
how do you make the swap file? what directory does the script go? what are the permission?
would be nice if you can give a step by step instruction
Thanks in advance

I forget the step by step but you can just google it, ain't that hard to setup. My kang already has the groundwork for it since I have a script setup. A heads up though, swapping on android off of an SD card significantly reduces the life of your SD card and isn't really advised.

Related

Why do we optimize?

I was just wondering, why do we try to optimize stock .apks? If HTC or T-Mobile released them, I doubt they would purposely bloat them up or anything to make them even the slightest bit slower. What if our "optimizing" instead has zero or in fact adverse side effects? My point is if it could be further optimized, then HTC would do it. (This is just out of curiosity)
Well, to be brutally honest, I highly doubt T-mo, HTC, etc. actually goes through their newly made apk, to look for any and all optimizations right off the bat, their most likely far too busy, and odds are, they could care less, as long as it fits in the first place.
As far as adverse effects, I for one haven't noticed anything slow/unacceptable about any apps, I've ever used
And most of the optimizations are so that the apk will fit in the actual ROM release ( guessing here, I'm not really a 'developer' ;P ) givin' that the rom contains many apps/etc.
Although with most apps2sd stuff going on now, I don't see the point, but it's still valid
(Look at in the eyes of a user, if a file is 20mb, and takes 20secs to dl, or 10mb and takes 10secs to dl, for the exact same thing, which would you pick?)
Hope I cleared up some stuff, or at least brought up some more/different questions xD
The real reason? So "devs" can type "ZOMG! Optimized all apks!!!" on their rom descriptions. The supposed "optimization" boils down to two steps: using optipng or roptipng; a tool that does some agressive, yet still lossless, compression passes to png formated images and reduces their sizes by certain amounts (depending on previous compression, up to ~60%), and then running zipalign; a tool from the android sdk that aligns the zip/apk to dalvik memory so that loading and execution become a tiny bit faster.
coolbho3000 made a windows bat script that does all that automatically plus a third step, compressing the apk/zip to anorexic levels with an agressive, mx5 zip compression. This usually cuts down the size of the /system/app folder a reported 10%.
Why do it? Size. It's the ONLY advantage. Most people seem to forget that compression requires decompression at runtime, and the more aggresive the compression algorithm used, the more cpu cycles and memory it requires to decompress, in fact, making your whole experience slower and less enjoyable. About the only thing that's beneficial in the whole "optimization" is running zipaling, but then whatever gain is lost by the heavy compression everywhere.
Don't get me wrong, shrinking everything has it's advantages, for example, I was able to whip a WHOLE Hero build into the space of the death spl's /system partition because of compression, but actual usage was frustrating because the system would so often run out of memory (or, if used with 64 MB compcache, be just too slow). I actually created another build (just a test) with no compression anywhere, just zipalign, and it was so enjoyably fast, but having only 20 MB left in /data after a fresh install is no fun...
So there you go! roptipng>7za>zipalign make all masters of "optimization" (we have only about 1 person here in the forum who's actually gone on the nitty-gritty of editing baksmali dumps and actually trying to make the damn thing run faster/properly).
If you have ever had T-Mobile motorola Z3, then you kow that T-Mobile DOES slow down the os on phones they can, or at least some of their proprietary apps do, like my faves, cause thats what got me into modding a lot, (and comp programmin ) i just wanted a faster z3 lol.

[MINIGUIDE][CM7|Stock] V6 Supercharger for the 2x (Smoothness & Snappyness)

.
Attention: This guide is for an older version of the V6 SuperCharger.
This doesn't mean that you can not use this guide as a reference or interesting read, but the new script has some more options which aren't covered here. You have to read the instructions within V6 carefully.
I did a lot of testing some weeks ago and now that I finally have some time I'd like to share what I got so far.
The V6 Supercharger is a tweak skript by zeppelinrox which works really great on my 2x. It feels smoother and snappier than ever - and multitasking is damn fast (and I never felt that CM7.2 was unsnappy.. but there is a difference now).
I won't talk a lot about what it is and how it does work - read the original thread. It has an even better effect on low spec phones, but it does improve the snappyness on high-end phones, too (and is even used on Samsung Galaxy S II and Galaxy Nexus phones!)
[Script][MOD][U9RC6.1] Sticky 'n Smooth ISCream-=V6 SUPERCHARGER!=-The ONLY RAM Fixer
All credits go to zeppelinrox for this great script!
Here's a quote for what it does:
zeppelinrox said:
What's it do?
It makes your phone FAST... super snappy with better multitasking!
It rearranges and fixes the OOM Groupings and Priorites and lowmemorykiller values.
So basically, it's a COMPLETE MEMORY MANAGEMENT FIX!
It's the ONLY one of it's kind
NO LAUNCHER REDRAWS, faster than ever, multitasking is better... why?
Because it works with the lowmemorykiller and letting it work the way it's meant to work.
Click to expand...
Click to collapse
Warnings:
This is not for ICS! Go to the 2nd post in the thread linked above - there are instructions for ICS (CM9) - I don't use CM9 yet and don't want to include instructions here, which I haven't tested thoroughly.
You shouldn't use this with custom kernels (like vadonkas) I guess - it might break some tweaks from the kernel devs.
I tested this with CM7.2 (temasek KANG) with the stock CM-kernel and it is working GREAT! It should make an even greater difference on Stock - please report!
I tested lots of options and never had a single problem.. but you should do a nandroid backup! There is always a slight chance that something goes wrong.
Click to expand...
Click to collapse
Instructions:
(type all options without quotes.. I hope that's obvious)..
Go to Settings - Cyanogenmod - Performance and make sure that "Lock home in memory" is not checked. If it is: uncheck it and restart (don't worry, the tweak will take over with a better solution than a permanent lock in memory).
Download the "V6_SuperCharger_for_Android-update9_RC6.1.sh.txt" from the original thread or from the attachments here and put it to the root directory of your SD card.
Open "Terminal Emulator"
Type "su" (and approve the Superuser request)
Type "cd /sdcard"
Type "sh V6*" (this is cAsE-sensitive)
The first time "wizard" will guide you through the installation process.
for the scrolling speed "2" is a good choice for the first time
type "b" for the build.prop option
type "y" to integrate /init.rc
I disabled the "AWESOME" animation (type "y") because it would get annoying after waiting for it to finish after the 3rd time.. sorry for that zeppelinrox
press the enter key
now type "10" (Quick V6 Custo-OOMizer option)
type "y" to use the calculated values
press enter twice
type "29" to reboot and wipe dalvik cache. The restart will take a while, be patient, that's normal!
that's it!
Click to expand...
Click to collapse
There's a "quick walkthrough" in the second post - together with the best options (at least for me) for the older update 8.
Again: All credit to zeppelinrox - he has a donation link in his thread! If you like it, donate to him please
Quick walkthrough - commands only (update 9 RC6.1):
("type Enter key" or "type any key" not mentioned)
Code:
su
sh /sdcard/V6*
2
b
y
y
10
y
29
Click to expand...
Click to collapse
------------------
Instructions for the "older" update 8:
Go to Settings - Cyanogenmod - Performance and make sure that "Lock home in memory" is not checked. If it is uncheck it, restart the device and recheck
(don't worry, the tweak will take over - I didn't have a single launcher redraw).
Download the "V6_SuperCharger_for_Android-update8.sh.txt" from the original thread or from the attachments here and put it to the root directory of your SD card.
Open "Terminal Emulator"
Type "su" (and approve the Superuser request) (without quotes.. I hope that's obvious)
Type "cd /sdcard"
Type "sh V6*" (this is cAsE-sensitive)
Type "0", "1", "2", or "3" to set how fast the text will scrool. "2" is a good selection for the first time.
Choose "9"
Type "16" (your device will restart without further warning!)
Click to expand...
Click to collapse
tonydl said:
under construction
Click to expand...
Click to collapse
Great but hard to set
PYCON said:
Great but hard to set
Click to expand...
Click to collapse
Sorry.. I wrote that because I pressed "Submit New Thread" accidentally before the post was ready. It's up now
there is already a update 9, which works perfect on the speed, but I don't see great improvements between Chuck Norris Edition with and without V6. Think Chuck Norris is already so awesome.
P.S: really easy to set up, just download Script Manager from the Market, open it, click on SU and open up this Script, everything else will be explained through the MENU
Has anyone tested this with the latest vadonka's ETaNa yet?
I know it's not ready yet, but I'm already psyched about it :-D
I already have a question about it.
If I run this skript is it suggested to change minfree values?
I have mine set on 16-24-32-90-100-110 right now. Thats pretty heavy I think, but Setiron suggested those values.
---------- Post added at 08:22 PM ---------- Previous post was at 08:19 PM ----------
TweetyPeety said:
there is already a update 9, which works perfect on the speed, but I don't see great improvements between Chuck Norris Edition with and without V6. Think Chuck Norris is already so awesome.
P.S: really easy to set up, just download Script Manager from the Market, open it, click on SU and open up this Script, everything else will be explained through the MENU
Click to expand...
Click to collapse
Hey, can you tell us how long you've been using this?
And can you tell us where you actually saw the improvement?
TweetyPeety said:
there is already a update 9, which works perfect on the speed, but I don't see great improvements between Chuck Norris Edition with and without V6. Think Chuck Norris is already so awesome.
Click to expand...
Click to collapse
Yup but update 9 is still a RC. I know it's pretty stable but haven't tested it yet, will do that over the weekend and update the instructions if everything works fine.
You're correct - the Chuck Norris ROM does use a lot of tweaks, too - this is mainly focused to non-tweaked CM7 and Stock ROMs
Great... I include always it in my rom...
Inviato con il mio P990 DjangoManouche!
Wow, thanks very much, my device feels superfast right now!
Do i have to repeat this procedure everytime i flash an cm update, e.g. a kang?
this script only advantage the bulletproof/hard to kill launcher for as, but since the o2x is a highend phone the launcher reload fast, probably dont even noticed that and if you have a memory hungry launcher probably not a bad thing if this is not stuck in the memory, so its not really necessary this. bulletproof the launcher is good thing in an old phone like moto milestone (this script originally made for that phone by the way)
the memory management is not so good, the autokiller memory optimizer app do a much better memory management and its user friendly.
also this script minfree values is not optimized for the o2x.
I'd rather not use overall, but its your choice guys
vadonka said:
this script only advantage the bulletproof/hard to kill launcher for as, but since the o2x is a highend phone the launcher reload fast, probably dont even noticed that and if you have a memory hungry launcher probably not a bad thing if this is not stuck in the memory, so its not really necessary this. bulletproof the launcher is good thing in an old phone like moto milestone (this script originally made for that phone by the way)
the memory management is not so good, the autokiller memory optimizer app do a much better memory management and its user friendly.
also this script minfree values is not optimized for the o2x.
I'd rather not use overall, but its your choice guys
Click to expand...
Click to collapse
I cannot agree in all points.
First of all V6 won't lock the launcher in memory (unlike the CM method!).
Then it will tweak more aspects in terms of memory management than just the "harder to kill launcher" - more on that in the official post. Last but not least - the phone is a highend one, but it lacks some memory (1GB would have been great). And it seems that it does help quite a lot, here.
But of course you're correct that it might not be the "best of all" solutions for the 2x - but I can feel quite a difference while using V6. For Stock LG and CM7 it seems to be a good enhancement - I don't mind if people here use it or not, I'm really happy with this solution right now. Just thought might be worse sharing as there are many threads for V6 for other phones (even the SGS II!!), but not for the 2x.
Just my 2 cents.
P.S.: I havent tested your newest kernel with the tweak scripts - maybe it will even blow me away more if the values are more optimized for the 2x
tonydl said:
I cannot agree in all points.
First of all V6 won't lock the launcher in memory (like the CM method!).
Then it will tweak more aspects in terms of memory management than just the "harder to kill launcher" - more on that in the official post. Last but not least - the phone is a highend one, but it lacks some memory (1GB would have been great). And it seems that it does help quite a lot, here.
But of course you're correct that it might not be the "best of all" solutions for the 2x - but I can feel quite a difference while using V6. For Stock LG and CM7 it seems to be a good enhancement - I don't mind if people here use it or not, I'm really happy with this solution right now. Just thought might be worse sharing as there are many threads for V6 for other phones (even the SGS II!!), but not for the 2x.
Just my 2 cents.
P.S.: I havent tested your newest kernel with the tweak scripts - maybe it will even blow me away more if the values are more optimized for the 2x
Click to expand...
Click to collapse
just look into this supercharger script and see what is really doing
I'll wait for ICS version of the script
PYCON said:
I'll wait for ICS version of the script
Click to expand...
Click to collapse
ICS is done. See post #2 of my OP.
vadonka said:
this script only advantage the bulletproof/hard to kill launcher for as, but since the o2x is a highend phone the launcher reload fast, probably dont even noticed that and if you have a memory hungry launcher probably not a bad thing if this is not stuck in the memory, so its not really necessary this. bulletproof the launcher is good thing in an old phone like moto milestone (this script originally made for that phone by the way)
the memory management is not so good, the autokiller memory optimizer app do a much better memory management and its user friendly.
also this script minfree values is not optimized for the o2x.
I'd rather not use overall, but its your choice guys
Click to expand...
Click to collapse
Will the REAL vadonka please stand up?
http://forum.xda-developers.com/showthread.php?p=14327296&highlight=supercharger#post14327296
vadonka said:
zeppelinrox: i use i&f 2.2 and now i installed your supercharger script v6, with the optiom oom fix and htk launcher. well, now the rom running even smoother than before. great job
Click to expand...
Click to collapse
lulz...
btw I'm sure you are totally unfamiliar with the newest incarnations where the values are calculated according the ram available on any device.
SO IT"S ALWAYS OPTIMIZED FOR THE DEVICE IT'S RUNNING ON.
If anything, bulletproof is BETTER suited for devices with more ram - since they can more easily do this without detrimental effects since they do have more ram.
Nothing you say adds up.
look, your script working superb on my old milestone, when i write this post what you quoted here i had the milestone not the o2x. but with o2x honestly i dont think its necessary to tweak so many memory management part. the phone have enough memory to handle most of everything and have a fast dual core processor.
i use only this:
echo 0,1,2,4,6,15 > /sys/module/lowmemorykiller/parameters/adj
echo 1536,2048,4096,15360,17920,20480 > /sys/module/lowmemorykiller/parameters/minfree
i dont see the point of the other stuffs
lock the launcher in the memory is also not necessary, its reloaded fast i dont even noticed that every time.
but its just my opinion
ps: you are using this file in many procedures: rcpath="/system/etc/rootfs/init.mapphone_umts.rc"
this isn't exsist in the o2x rom.
for example:
sed -i '/ro.EMPTY_APP_ADJ/ a\
setprop ro.FOREGROUND_APP_MEM '$SL1 $rcpath
this is only work if the rcpath=/system/etc/build.prop and cut out the 'setprop' string (/data/local.prop also not good for as). i also found some code what is not working with the o2x rom. the whole script is for the droid/milestone's. at least what i found in this thread OP
Try the newest one
http://forum.xda-developers.com/showthread.php?p=22689090&posted=1#post22689090
init.mapphone_umts.rc isn't even mentioned.
Instead, it does a search for the appropriate file.
It's vastly more sophisticated than Update 8 in all aspects.
The 0,1,2,4,6,15 is kinda useless... no different really than the default 0,1,2,4,7,15
There is a fairly new supercharger thread for the new Galaxy Note... they see a clear difference.
So you really won't ever know until you try
zeppelinrox said:
Try the newest one
http://forum.xda-developers.com/showthread.php?p=22689090&posted=1#post22689090
init.mapphone_umts.rc isn't even mentioned.
Instead, it does a search for the appropriate file.
It's vastly more sophisticated than Update 8 in all aspects.
The 0,1,2,4,6,15 is kinda useless... no different really than the default 0,1,2,4,7,15
There is a fairly new supercharger thread for the new Galaxy Note... they see a clear difference.
So you really won't ever know until you try
Click to expand...
Click to collapse
okay, this version it seems better: V6_SuperCharger_for_Android-Update9_RC6.1.sh
Yeah there isn't much difference between that and the one I linked to above if you're on CM7.
The incremental update was an ICS detection fix.
I may have all 4 scripts updated today tho
zeppelinrox said:
Yeah there isn't much difference between that and the one I linked to above if you're on CM7.
The incremental update was an ICS detection fix.
I may have all 4 scripts updated today tho
Click to expand...
Click to collapse
Hey zeppelinrox, do you recommend to change minfree values when using the v6 script?
I'm running CM9 with Ironkernel and mine are set to 16-24-32-90-100-110, but I think thats a little extreme. Setiron suggested those values, because ICS needs more ram.

FuFu 98swaponv5 mod - Internal storage swap!

Hello there! now that we have custom kernel, I want to share with you this Little trick I used in my old Motorola z6 when I used to develop xD
Due to the fact that memory cards have sometimes low data transfer rates, swapping on our devices sometimes is a Little bit slow... to solve the issue, I used to place a swapfile in the internal storage of the phone, wich has pretty fast data transfer rates... so I did this once again with my milestone, and the peformance is amazing!! I'm currently using CM7.2.4 with a 48mb swapfile placed inside /data...
Just wanted to share this with all the people of this community, I also modded the script written by FuFu, so the script insted of creating the swapfile in the sd-card, it creates it in /data
I won't post the modded script because I want FuFu himself to decide if the mod is OK, and make his own reléase! Just a matter of respect...
So that's it, try it out people, you're gonna be amazed....
no Problem, you can post your modded script here
i also tryed to use a swapfile on /data, but for me it wont work, if i try to use swapon on /data it sayes:
invalide argument
but i will take a look at your modded script and also i will include it in future updates
i think it may be very interesting for all users to get some extra performance
I'm not sure it is as good idea as it sounds first.
Memories based on flash technology are degrading when writing on it. (I know they are degrading anyway.)
Swapping means a lot of writing and reading and while you can easily buy a new SD-Card you cannot change your phone's internal memory.
Maybe my fears are baseless, but i don't wanna risk.
May someone with better knowledge correct me.
Plus, it is not possible to enable swap on yaffs filesystem "out-of-the-box" as they are incompatible.
I have CM7.2.4 now and three primary partitions on SD Card: Fat32, Ext2 and Linux Swap.
I installed 98swaponv5 after CM7.2.4 rom with OpenRecovery. Does 98swaponv5 have some settings or how I can know it's working?
Well it seems that I can multitask and change from Facebook to other apps and back and it doesn't reload, so I guess the swap is working.
But the default browser always reloads the page when I switch to the browser. Looks like all the other apps work great with the swap except the browser, I wonder why?
EDIT: Right now the browser doesn't reload anymore when I switch to it. I have rebooted and installed some apps, killed some apps. Looks like the Milestone just keeps getting better.
If you have Terminal Emulator installed, you can type free and it will show you the amount of total/used/free memory and in the row "Swap" the informations about swap.

Please help: big lag issue

Guys, I need a help. Tried everything, but still facing big lag especially when I click on dialer, contacts or messages (waiting couple of secs until they show up). This is more obvious when I click right after I 'woke up' my phone from deep sleep.
I'm using stock 20b with Iodak v8 kernel (tried v9 as well, but due to bluetooth and fm radio issue on stock, reverted to v8). Also, I did everything what I could found to improve performace: disabled and then deleted MLT, did a full wipe of everything (clean install), installed only apps that I need, turned off 3g, data and gps (only WiFi is on), installed Greenify and so on..
My current setup of kernel is following:
Governor: interactive (tried ondemand, but was even worst)
Max: 1600000
Min/Max Screen Off: 760000
Scheduler: SIO
CPUQuiet Power: userspace (noticed that only 3 cores are online instead of 4)
I appreciate any help, but please, don't tell me to search, 'cause I did. As for the other custom roms, I tried CM, but I prefer more stock, mostly because of Gallery, Polaris and FM Radio Apps.
Guys, is there any way to fix this lag issue? I don't care much for the battery, since this lag drives me crazy.
Thanks in advance.
Vladimir
vladja10 said:
Guys, I need a help. Tried everything, but still facing big lag especially when I click on dialer, contacts or messages (waiting couple of secs until they show up). This is more obvious when I click right after I 'woke up' my phone from deep sleep.
I'm using stock 20b with Iodak v8 kernel (tried v9 as well, but due to bluetooth and fm radio issue on stock, reverted to v8). Also, I did everything what I could found to improve performace: disabled and then deleted MLT, did a full wipe of everything (clean install), installed only apps that I need, turned off 3g, data and gps (only WiFi is on), installed Greenify and so on..
My current setup of kernel is following:
Governor: interactive (tried ondemand, but was even worst)
Max: 1600000
Min/Max Screen Off: 760000
Scheduler: SIO
CPUQuiet Power: userspace (noticed that only 3 cores are online instead of 4)
I appreciate any help, but please, don't tell me to search, 'cause I did. As for the other custom roms, I tried CM, but I prefer more stock, mostly because of Gallery, Polaris and FM Radio Apps.
Guys, is there any way to fix this lag issue? I don't care much for the battery, since this lag drives me crazy.
Thanks in advance.
Vladimir
Click to expand...
Click to collapse
This is "normal" for system apps. Download custom apps from google store like ExDialer,GOSms.. That will resolve your lag.. When you install those apps from store, use titanium backup to freeze stock apps(dialer,contacts,messages).
@vladja10 http://forum.xda-developers.com/showpost.php?p=49272503&postcount=1986
Thanks guys, but neither of these two options helped. There's some improvements, but still pretty much laggy.
Think I found out what causing lag: synchronization. Every time when phone is synchronizing, everything is so laggy, otherwise is ok. Following accounts have sync turned on: Skype, Facebook, WhatsApp, Twitter and Google.
Does anyone of you have experienced similar problem? Is there solution for this?
vladja10 said:
Think I found out what causing lag: synchronization. Every time when phone is synchronizing, everything is so laggy, otherwise is ok. Following accounts have sync turned on: Skype, Facebook, WhatsApp, Twitter and Google.
Does anyone of you have experienced similar problem? Is there solution for this?
Click to expand...
Click to collapse
I have all those apps running in my phone, but I did not face those lags.
But ya I did felt those lags when I'm still using stock JB OS. Stock JB from LG is sucks man, you should instal another ROM.
Currently I'm using CM11 (Kitkat 4.4.2 based), its lag free and have more free RAM. (around 350 - 400MB). :good:
The difference is like heaven and hell compared with the stock ROM (I only have 150 - 200MB Free RAM).
bomerzz said:
I have all those apps running in my phone, but I did not face those lags.
But ya I did felt those lags when I'm still using stock JB OS. Stock JB from LG is sucks man, you should instal another ROM.
Currently I'm using CM11 (Kitkat 4.4.2 based), its lag free and have more free RAM. (around 350 - 400MB). :good:
The difference is like heaven and hell compared with the stock ROM (I only have 150 - 200MB Free RAM).
Click to expand...
Click to collapse
The ROM can make a difference, but it has nothing to do with "Free RAM". I wish people would stop perpetuating this myth.
Free RAM is wasted memory on an Android device. Unless you are getting below about 50MB there is not a problem as the device is designed to use as much as it can and then swap it out automatically.
I agree about CM11 though. I'm running the latest nightly and the only problem I have is the delay in waking when you press the power button
SimonTS said:
The ROM can make a difference, but it has nothing to do with "Free RAM". I wish people would stop perpetuating this myth.
Free RAM is wasted memory on an Android device. Unless you are getting below about 50MB there is not a problem as the device is designed to use as much as it can and then swap it out automatically.
I agree about CM11 though. I'm running the latest nightly and the only problem I have is the delay in waking when you press the power button
Click to expand...
Click to collapse
Well.. Sorry for my false statement and thank you for correcting it
4X HD is my very first android device. But that's what I really thought after I flashed the CM11.. Its like whoa, more free space on RAM, and it feels like I'm using a new phone
bomerzz said:
Well.. Sorry for my false statement and thank you for correcting it
4X HD is my very first android device. But that's what I really thought after I flashed the CM11.. Its like whoa, more free space on RAM, and it feels like I'm using a new phone
Click to expand...
Click to collapse
You might want a read of this;-
RAM: What it is, how it's used, and why you shouldn't care
Well, I’m afraid that I’ll be forced to get back to CM (used it once, but missed some apps such are: FM Radio, stock gallery app (couldn’t find good replacement that synced photos with google acc) and Polaris Office – these apps I use on a daily basis). Anyway, before install CM, I’ll give one more try to Stock.
I did what @ottomanhero told me, and that actually helped. But, since I used Trickstermod to tweak governors, after every single reboot, stock values would be back, so I had to use init.d script, and there comes a problem.
Here is what I did (followed instructions from Iodak's OP):
- Using ES File Explorer created folder /system/etc/init.d and set permissions to rwxr-xr-x
- Created new file in init.d folder and name it 1script (used Note++ instead of Windows editors to avoid leaving an extra space at the end of each line or an invisible invalid character)
- Then added following commands:
Code:
#!/system/bin/sh
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/midrange_go_maxspeed_load
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 200 300 400 450 500 600 > /sys/devices/system/cpu/cpu0/cpufreq/gpu_overclock
- and finally set permissions to 1script rwxr-xr-x and owner to root group to shell
So, that should be it, but didn’t work for me. Then, I installed SManager to check what’s wrong with the script, and it stated that with first 4 lines error is: no such file or directory (which is strange because exactly that's the path), and for the last line is stated: permission denied.
Did I miss something? Apologize if this question is too noob for you guys, but I’m running out of ideas.
Thanks all for your help.
Regards,
Vladimir
SimonTS said:
You might want a read of this;-
RAM: What it is, how it's used, and why you shouldn't care
Click to expand...
Click to collapse
Oh, really?
Free RAM is NOT wasted RAM.
It directly effects smoothness of the phone.Why do you think android would have Out Of Memory values if it was created to just fill up the RAM with only apps? It still needs some RAM free for caching.
---------- Post added at 03:50 PM ---------- Previous post was at 03:46 PM ----------
vladja10 said:
Well, I’m afraid that I’ll be forced to get back to CM (used it once, but missed some apps such are: FM Radio, stock gallery app (couldn’t find good replacement that synced photos with google acc) and Polaris Office – these apps I use on a daily basis). Anyway, before install CM, I’ll give one more try to Stock.
I did what @ottomanhero told me, and that actually helped. But, since I used Trickstermod to tweak governors, after every single reboot, stock values would be back, so I had to use init.d script, and there comes a problem.
- and finally set permissions to 1script rwxr-xr-x and owner to root group to shell
So, that should be it, but didn’t work for me. Then, I installed SManager to check what’s wrong with the script, and it stated that with first 4 lines error is: no such file or directory (which is strange because exactly that's the path), and for the last line is stated: permission denied.
Did I miss something? Apologize if this question is too noob for you guys, but I’m running out of ideas.
Thanks all for your help.
Regards,
Vladimir
Click to expand...
Click to collapse
Code:
#!/system/bin/sh
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
echo "70" > /sys/devices/system/cpu/cpufreq/interactive/midrange_go_maxspeed_load
echo "60000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo "200 300 400 450 500 600" > /sys/devices/system/cpu/cpu0/cpufreq/gpu_overclock
I think the script didn't execute at boot due to last line, you forgot the quotes.And while using Smanager you gotta tick "root" or else it won't run.Try this one
ottomanhero said:
I think the script didn't execute at boot due to last line, you forgot the quotes.And while using Smanager you gotta tick "root" or else it won't run.Try this one
Click to expand...
Click to collapse
Well, you were right about the quotes (now, the new values are set), but as the other 4 lines, they still have the same error: No such file or directory, and all values are stock.
Do you have any idea what's going on? Why did it work for one, and didn't for the other lines?
http://forum.xda-developers.com/showthread.php?p=48042187#post48042187
ottomanhero said:
Oh, really?
Free RAM is NOT wasted RAM.
It directly effects smoothness of the phone.Why do you think android would have Out Of Memory values if it was created to just fill up the RAM with only apps? It still needs some RAM free for caching.
Click to expand...
Click to collapse
As I stated in my first post;-
Unless you are getting below about 50MB there is not a problem
Click to expand...
Click to collapse
Of course you need some free memory, but not hundreds of MBs of it. I notice that you pointed the same XDA quote that is used and linked to by lots of different sites when this is being discussed. To use someone else's quote - better written than I could do so myself;-
In the most simplistic terms, here is how it works, and why "free RAM is wasted RAM," but also, why you don't want all RAM in use at any given time.
If an application is not in memory when you try to open it, that application haa to be loaded into memory, thus triggering a "load time." Having the application in memory (prefetched) prevents this load time and has the application load near insantly. This is why a modern OS will preload our most commonly used applications into memory. The more memory that you have, the more applications that can be preloaded, the smoother your device will run. Clearing this memory gives you no immeidate benefit, and will actually slow your device. Idle applications in memory consume almost no resources (CPU cycles, battery power, etc.). If an application is consuming resources, that means that it is doing something. Closing it will only force the application to re-load. Using a task killer for this purpose will cause a "boxing match" where the task killer closes the application, the app reopens itself, and back and forth. THIS will consume resources.
However, you want to have some memory free. Your devices will not have enough memory to preload EVERY application, so it has to guess based on your actions. It needs to have enough memory available to quickly load an app that you may want.
Let's say that you want to load an application that requires 256MB of RAM, but you only have 128MB available. This means that the OS is going to try to clear 128MB of RAM to accomodate your app, and as your app loads, will try to clear another 128MB to return to its previous state. This clear/load/clear causes a longer load time and more slowdown than just loading an app not already in memory.
So, the ideal situation is to have most common apps in memory (pre-fetched), but enough memory available to handle 1-2 common apps that are not already pre-loaded. Touchwiz (Samsung) devices allow you to clear memory from the task manager. My S2 had about 870MB of user-available RAM, and if I trashed all apps, it would go as low as 300MB in use. This may look cool, but it is a complete waste of resources, and the OS is simply going to re-load those apps over the next 2-3 minutes anyway. And if you use a task killer to keep your device idling at 300MB of available RAM? This is simply going to slow down the device, harm the battery, and give you the same memory performance and availability that you would get with an HTC G1.
Click to expand...
Click to collapse
As the OP was stating that "I only have 150 - 200MB Free RAM" with the Stock ROM, that is definitely NOT what is causing a lag issue. If you have that much free memory (before Android goes caching stuff and not declaring it of course) then you are absolutely fine on any Android device there is.
vladja10 said:
Well, you were right about the quotes (now, the new values are set), but as the other 4 lines, they still have the same error: No such file or directory, and all values are stock.
Do you have any idea what's going on? Why did it work for one, and didn't for the other lines?
Click to expand...
Click to collapse
Maybe your partitions aren't mounted.I took these lines from pimp my rom init.d script.Create another script but it has to come before the governor tweaks script.
#!/system/bin/sh
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier =0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /cache
Click to expand...
Click to collapse
For example, name this script "93Mount" and name the governor script "94Governor" so the mounting script will be executed before governor script.
ottomanhero said:
Maybe your partitions aren't mounted.I took these lines from pimp my rom init.d script.Create another script but it has to come before the governor tweaks script.
For example, name this script "93Mount" and name the governor script "94Governor" so the mounting script will be executed before governor script.
Click to expand...
Click to collapse
Well, I did like you said and here's what I got:
Code:
exec /system/bin/sh '/etc/init.d/93Mount'
h '/etc/init.d/93Mount' <
failed: No such file or directory
failed: No such file or directorybh on /data
mount: mounting atime,barrier=0,nobh on /cache failed: Invalid argument
Any idea?
For the People who want Stock Gallery on CM and hate Aosp Gallery like Iam, check facebook offical cyanogenmod. They send a link to their new gallery next. Its in beta stase, so its not avaible yet. But if its stable itll be in play store. Its like the stock gallery app. Very beauty
Sent from my LG-P880 using xda app-developers app
vladja10 said:
Well, I did like you said and here's what I got:
Code:
exec /system/bin/sh '/etc/init.d/93Mount'
h '/etc/init.d/93Mount' <
failed: No such file or directory
failed: No such file or directorybh on /data
mount: mounting atime,barrier=0,nobh on /cache failed: Invalid argument
Any idea?
Click to expand...
Click to collapse
Well try this app https://play.google.com/store/apps/details?id=com.stericson.remount&hl=tr
EDIT : check this link out. http://forum.xda-developers.com/showthread.php?t=1381188
I'm not sure it's the right track or not, it does happen to me quite ago.
The problem is the SD (my case, luckily it's external). The system try to read files from card but it got error thus try again => laggy
I removed the card and it's alive. Try to check your internal sd. hope that help
App didn't help, I got the same error. Never mind, I give up Will use Trickstermod after every single reboot until finally find solution. Thanks @ottomanhero for all your help.
@GalaxyVolvoZ that app looks realy nice. Finally a good replacement for Stock Gallery.
@klbterminator I don't have any problems with SD, at least didn't so far
Thanks guys.
Regards,
Vladimir

[MODULE] Automatic SQLite DB Optimizer

Automatically optimizes SQLite databases on boot, on schedule, every X days.
Just a quick and dirty adaptation of an old SQLite3 optimizer script from init.d days to a Magisk Module using a service.sh script instead, with an internal date offset mechanism to run the script every X days (default: 3 - which is plenty, and specifically to stop silliness).
Update And credit note: finally after a fair bit of digging, i think i located the original author of the original init.d version of the main vacuum code snippet ive repurposed (stolen) for this module. It appears to be from user @mcbyte_it (doesnt seem to be current or active) and from a post here. Although i only saw derivative reworkings of this script, and used only the main sqllite script function, i arrived at a different method of tracking last run date, when his is arguably more mainstream/concise. Im fairly certain this is the originator especially as the post also has a zipalign script that was also suggested to me to do....and which i have been fiddling with for months....
The script will wait until boot is completed AND then until avg CPU usage is under 30%, to minimise the risk of possible corruption.
Disclaimer: As always any use of any 3rd party script/software/advice is at the users discretion. All reasonable efforts have been made to make this as safe as possible, but the responsibility ultimately falls to the user whether to use and run the script.
What it does:​It:
Reindexes
Vacuums
Analyzes
all .db files under /data.
It runs a 1st run optimize after install (temp file optimsql_first_run on sdcard is used to enable this, and removed after first run), and then on schedule after that.
By default it logs just script progress to /storage/emulated/0/autosqlite.log, but you can choose to enable more detail in the log if you wish
​User Configurable Options:​The schedule and loglevel can be changed by an external file on sdcard:
Create a file named autosqlite_options on sdcard (/storage/emulated/0/)
Inside create the follow key=value pairs to suit your preference:
interval=x (where x is the number of days between script runs, for the love of god do not put 1 (this goes out especially to the kind of people who put every app on their Magisk magiskhide/deny list) there is no benefit and you just heighten the possibility of corruption)
loglevel=x (where x is either 1 (detailed logging) or 0 (basic logging - default))
Requirements:​This module requires a working SQLite3 binary. If your ROM does not provide one (you can check via typing sqlite3 into a terminal), you can choose to use my SQLite3UniversalBinaries module located here:
https://github.com/stylemessiah/SQLite3UniversalBinaries
Dont forget you need to download a named SQLite3UniversalBinaries.vx.x.zip file from the Releases page under Assets. Do not try installing the source code with Magisk Manager, it will not go as you expect
All the modules action takes place in the service.sh file, its commented reasonably well for those wanting to check how it works
* See... now theres something else to use with my SQLite3 Universal Binaries module other than the GPay SQlite Fix Module <- dont use that anymore, it makes me stabby. It is literally the last resort for getting Google Pay/Wallet to work ,
Please note: the included LICENSE only covers the module components provided by the excellent work of @Zackptg5 's Magisk Module Extended, which is available for here for module creators
https://github.com/Zackptg5/MMT-Extended/
All other work is credited above and no one may fork or re-present this module as their own for the purposes of trying to monetize this module or its content without all parties permission. The module comes specifically without an overall license for this intent.
Download:
Repo: https://github.com/stylemessiah/AutomaticSQLiteDBOptimizer
Release: https://github.com/stylemessiah/AutomaticSQLiteDBOptimizer/releases/latest
Powered by Ponkle
@73sydney Nice! If you're looking for newer sqlite3 binaries, I have a build script you can use to build it or you can just grab the precompiled ones at my repo: https://github.com/Zackptg5/Cross-Compiled-Binaries-Android
Zackptg5 said:
@73sydney Nice! If you're looking for newer sqlite3 binaries, I have a build script you can use to build it or you can just grab the precompiled ones at my repo: https://github.com/Zackptg5/Cross-Compiled-Binaries-Android
Click to expand...
Click to collapse
cheers man, i was trying not to pinch all your toys
i mean i could have done an androidacy and scraped your repo for just the files i needed
plus im lazy
73sydney said:
optimizes SQLite databases
Click to expand...
Click to collapse
Nice
how about no schedule, i want to execute it whenever i want
possible ?
loopypalm said:
Nice
how about no schedule, i want to execute it whenever i want
possible ?
Click to expand...
Click to collapse
I refer the gentleman to the name of the module and title of the thread:
"Automatic SQLite DB Optimizer"
the distinct lack of the word "manual" should be a clue
what are they teaching in school these days?
i made this to be automatic and made special note about the intervals because theres people who would abuse this and run it every day if they could, both designed to avoid misuse/abuse:
interval=x (where x is the number of days between script runs, for the love of god do not put 1 (this goes out especially to the kind of people who put every app on their Magisk magiskhide/deny list) there is no benefit and you just heighten the possibility of corruption)
im not really interested in making a manual version option unless you can convince me where there is a use case benefit, because all i see is potential for misuse/abuse that i specifically made this to avoid....
running it by default it runs every 3 days which is twice a week and probably still overkill, but trying to cover all bases
your other option is to ask me for permission (sadly because of abuse in the past from certain entities trying to monetize my and others work, my contributions are not GPL etc) to fork and alter the code yourself....
73sydney said:
I refer the gentleman to the name of the module and title of the thread:
"Automatic SQLite DB Optimizer"
the distinct lack of the word "manual" should be a clue
what are they teaching in school these days?
i made this to be automatic and made special note about the intervals because theres people who would abuse this and run it every day if they could, both designed to avoid misuse/abuse:
interval=x (where x is the number of days between script runs, for the love of god do not put 1 (this goes out especially to the kind of people who put every app on their Magisk magiskhide/deny list) there is no benefit and you just heighten the possibility of corruption)
im not really interested in making a manual version option unless you can convince me where there is a use case benefit, because all i see is potential for misuse/abuse that i specifically made this to avoid....
running it by default it runs every 3 days which is twice a week and probably still overkill, but trying to cover all bases
your other option is to ask me for permission (sadly because of abuse in the past from certain entities trying to monetize my and others work, my contributions are not GPL etc) to fork and alter the code yourself....
Click to expand...
Click to collapse
i was planing to use it once a week
categorizing me with people who do dumb stuff is an 'insult'
i asked a simple question man, don't jump to level 3 mind game please ...
loopypalm said:
i was planing to use it once a week
categorizing me with people who do dumb stuff is an 'insult'
i asked a simple question man, don't jump to level 3 mind game please ...
Click to expand...
Click to collapse
Im sorry, did you miss the double smileys intended to completely avoid any misunderstanding that i was being jovial. the other tip off that i wasnt burning you was taking the time to write several paragraphs
Can i suggest you just set the options file interval to 6 or 7 and let the module do what its described in the title as doing, it would make no functional difference, other than saving you a trip to terminal?
As i said, give me a valid reason for adding a manual option and ill gladly consider it, choosing a reason that fits completely within the actual parameters of the existing module doesnt really fit that offer...
ill go further to why i specifically didnt put in an option to run it manually (really folks are lucky i didnt block the option to run it every day) because you should understand what the sqlite vacuuming and other processes do:
* They copy the data from the db file to temp file before optimising it and writing it back, at any point in this theres the potential for corruption (sudden power loss, other processes accessing the file etc). Ideally any such corruption would be minimised by journaling but anyone who had used Linux for long enough knows not to count on such things.
* If any db is being written to, then the optimization process will NOT optimize that db...for the above possible corruption reasons. Hence why i not only put in a wait till boot completed function BUT also added a function to block the script from running unless avg cpu load over 5 minutes is less than 30%. all this to try and make things as safe as possible. So im not overly fond of a manual option which bypasses these safeties i specifically put there to hopefully safeguard people as best as possible. I dont want to get messages about how my module hosed someones apps.
Perhaps that better addresses my reasons?
As said, you can also ask me to fork the code, and ill even tell you how to add a manual function, but i personally wont be releasing such a version without a better reason than i want to do it every 7 days, when the script as it stands can do that AND at a far more predictably safe time and way than you manually likely can or will use it....
BTw, how is actually responding, even taking the time to do so and being jovial about it "level 3 mind games?", whatever the hell that even is?
73sydney said:
.
Click to expand...
Click to collapse
i was planing to make a recovery backup of "DATA" after the optimization of DB files ...
if you want better result add a comand to kill the coresponding app, then it would be more stable
or tell the people to use FlushRam or something like that before the proccess start, to make sure the result will be good, or make a 2nd module for advanced users ...
even with the condition you said some system apps stays working in the background and messing with their data can lead to corruption
i don't know you or your previous work and i don't have time to care for that
i just asked a simple question
answer with "NO, my module will not do that"
this will save your time and other people time
loopypalm said:
i was planing to make a recovery backup of "DATA" after the optimization of DB files ...
if you want better result add a comand to kill the coresponding app, then it would be more stable
or tell the people to use FlushRam or something like that before the proccess start, to make sure the result will be good, or make a 2nd module for advanced users ...
even with the condition you said some system apps stays working in the background and messing with their data can lead to corruption
i don't know you or your previous work and i don't have time to care for that
i just asked a simple question
answer with "NO, my module will not do that"
this will save your time and other people time
Click to expand...
Click to collapse
1) whether before or after backup, the files will eventually get optimized - if you want a more manual version use SD Maid or as offfered you can ask me how to alter the code as it sits and make your own version.
2) Im not ever releasing a script that kills anyones apps in the background, i would consider that suboptimal, and basically malware
3) I never said that some "system apps stays working in the background and messing with their data can lead to corruption". What i said was i designed the script to best avoid corruption by running only after boot completed and when avg CPU usage over 5 minutes was less than 30%. The sqlite3 itself generally wont allow access to a file in use. Im just adding what i think is a reasonable level of extra safety by deciding when the optimization routine starts to run, and that it isnt abused/misused by running multiple times in an unreasonable timeframe
4) How does
I refer the gentleman to the name of the module and title of the thread:
"Automatic SQLite DB Optimizer"
the distinct lack of the word "manual" should be a clue
not equal "NO, my module will not do that", only with some attempt at humour and a long explanation (soon followed by a more reasoned explanation) because i didnt want to appear dismissive. Yet it looks like you’d have preferred dismissive??
You seem impossible to please anyway someone tried to do it....
To be honest Im tired of this circular conversation. Everyone else knew from the word automatic in the title how things was going to work. Ive made suggestions of alternatives (SD Maid) and even offered to give you the info to change the script for yourself, and cant do more than that.... please choose one and lets move on, please?

Categories

Resources