mFSTRIM: A REAL, FOSS fstrim utility for Android, no root necessary - Paid Software Announcement and Discussion

Hey XDA!
I actually just posted about another app called Buoy, but over my spring break I went ham and made four apps and I wanted to show off two of them to get some feedback. So here's mFSTRIM!
What is fstrim?
So you know how hard drives get fragmented over time right? Data is placed far apart from other data, increasing latency as the disk needs to physically seek to a certain partition of the disk to read/write data. Well, flash storage doesn't really get fragmented. Instead, when parts of the flash are deleted, the system doesn't actually have a way of knowing which sectors it doesn't care about anymore, and which ones it does. So we go through periodically and TRIM (hence fstrim, the command line utility that does this) all the unused blocks so the system can use them again.
Doesn't Android ALREADY fstrim regularly?
Well, sorta. Newer versions of Android will check at midnight if the device is alive at midnight and is currently charging. If so, it will run fstrim during the next time the device is idle and charging. But what about if that can't happen? I, for one, don't plug my phone in overnight because I care about my battery health. Android also imposes an upper limit! If the device has not run fstrim within the past 3 days, it will force one during the next bootup. And here's where mFSTRIM comes in...
How does mFSTRIM work?
mFSTRIM uses Secure Settings to change how long Android can go without an fstrim before forcing one during bootup. With that logic, we can set that interval to 1 millisecond (aka, one is ALWAYS needed), so that during every reboot, an fstrim is done.
Links
Play Store: https://play.google.com/store/apps/details?id=com.draco.mfstrim
GitHub: https://github.com/tytydraco/mFSTRIM
Feedback is appreciated!

Is there a free version?

orb3000 said:
Is there a free version?
Click to expand...
Click to collapse
Hi,
Sorry, I didn't release a free version since the app is really simple. But just a tip: once you change the setting, it persists even after you uninstall. So do what you want with that information

This is awesome! Any chance to add the ability to run fstrim whilst in the app on demand?

fobtob387 said:
This is awesome! Any chance to add the ability to run fstrim whilst in the app on demand?
Click to expand...
Click to collapse
Hey! Sadly this isn't possible due to the way the app works. Internally in Android there's a setting that tells the system the longest we can go without doing an fstrim on bootup. My app simply changes this setting. The fstrim is actually done by Android still, not my app. Since the only time Android checks our newly changed setting is on a reboot, we have to reboot to make it happen. With root I can do what you suggested, but sadly without root it's not possible.

tytydraco said:
Hey! Sadly this isn't possible due to the way the app works. Internally in Android there's a setting that tells the system the longest we can go without doing an fstrim on bootup. My app simply changes this setting. The fstrim is actually done by Android still, not my app. Since the only time Android checks our newly changed setting is on a reboot, we have to reboot to make it happen. With root I can do what you suggested, but sadly without root it's not possible.
Click to expand...
Click to collapse
Would it be possible to make a root variant?

fobtob387 said:
Would it be possible to make a root variant?
Click to expand...
Click to collapse
It's possible! Also, you can run this via the command line with ADB (no root): adb shell sm fstrim
That forces an fstrim

Nice app! I set it to fstrim on reboot, and sure enough the "last-fstrim" file was modified at boot to confirm fstrim took place. The app is free in the Play Store now (reading the previous comments and it seems this may not have been always the case). I also like that the app doesn't use the network for anything at all (no analytics). I'm rooted, so it did ask me to grant root when starting it up for the first time.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Hey! Can we please be able to create a custom interval for fstrim?
My phone becomes slow after like 5 mins of fstrim so I'd need this to run every like 1-2 seconds. I don't want to root my phone xd

Auditormadness9 said:
Hey! Can we please be able to create a custom interval for fstrim?
My phone becomes slow after like 5 mins of fstrim so I'd need this to run every like 1-2 seconds. I don't want to root my phone xd
Click to expand...
Click to collapse
No
No
No
No, you definitely do not want to fstrim every 1-2 seconds
No.....
Your "slowness" probably comes from the discard option on the mount point, if its EXT4, takes longer to do its job
Running fstrim multiple times wont fix that

73sydney said:
No
No
No
No, you definitely do not want to fstrim every 1-2 seconds
No.....
Your "slowness" probably comes from the discard option on the mount point, if its EXT4, takes longer to do its job
Running fstrim multiple times wont fix that
Click to expand...
Click to collapse
Oh bummer. And what would fix that slowness then?

Auditormadness9 said:
Oh bummer. And what would fix that slowness then?
Click to expand...
Click to collapse
Without root nothing you do will change a thing
fstrim other than the stock ROM scheduled one will not work without root

73sydney said:
Without root nothing you do will change a thing
fstrim other than the stock ROM scheduled one will not work without root
Click to expand...
Click to collapse
Got it. And one more thing. Do you think this would work if I had root?
SSD Boost - Apps on Google Play
Minimizes writings on the your phone's SSD, increasing speed and extending life
play.google.com

Auditormadness9 said:
Got it. And one more thing. Do you think this would work if I had root?
SSD Boost - Apps on Google Play
Minimizes writings on the your phone's SSD, increasing speed and extending life
play.google.com
Click to expand...
Click to collapse
For starters its not my app, and theres no real detail on what it does beyond change a few mount point options - which you can probably find already (depending on android level and ROM) exists (noatime already on my ROM) by the following in a terminal:
mount | grep noatime
and/or
mount | grep nodiratime
As for its other listed function, running TRIM on demand, theres this app which has been around forever and is ad free
Trimmer (fstrim) - Apps on Google Play
Trim your device NAND chip manually and fix lags.
play.google.com
As for the app you quoted generally, realise its *possible* to brick your device doing some of the things it claims, so check the warnings
Also the author even points out it doesnt actually boost an SSD, it just changes some kernel and mount options that *may* improve filesystem performance
Note: I just tried running SSD Boost on my Pixel 2XL...toggled it on, and it sat there forever saying "Boosting your SSD", and sat there a long time (to the point i thought id have to kill it), and then showed it had made some changes (factoring in i already had noatime set)
Heres some tests before
and after....
Androbench:
Seq Read: +15MB/s
Seq Write: +12MB/s
Ran Read: -3MB/s
Ran Write: +0.4MB/s
SQLite Insert: -57 QPS
SQLite Update: -101 QPS
SQL Delete: -74 QPS
SD Card Test Pro:
Write: +95MB/s Read: +20MB/s
Would i bother installing it (if its safe for your device)...as always , up to the individual. As always these are benchmarks, and just a snapshot in time, real world result in real world usage, dunno if you’d notice

73sydney said:
Without root nothing you do will change a thing
fstrim other than the stock ROM scheduled one will not work without root
Click to expand...
Click to collapse
Why are you posting misleading info? The other user (quote below) actually verified the operation, and it works!
ninjæon said:
Nice app! I set it to fstrim on reboot, and sure enough the "last-fstrim" file was modified at boot to confirm fstrim took place. The app is free in the Play Store now (reading the previous comments and it seems this may not have been always the case). I also like that the app doesn't use the network for anything at all (no analytics). I'm rooted, so it did ask me to grant root when starting it up for the first time.
View attachment 5382223
Click to expand...
Click to collapse
I observed the same change in last-fstrim date! The utility works, it's great!!! Surprising so few people noticed it ...

Thanks for this!
Somewhat related question: will TRIM prevent data recovery?
From my understanding, when you delete data from an SSD it will just remove it from being viewed and allow it to be overwritten but the data is still there and can be recovered through recovery apps or forensics.
Does TRIM prevent this?

DonDizzurp said:
Thanks for this!
Somewhat related question: will TRIM prevent data recovery?
From my understanding, when you delete data from an SSD it will just remove it from being viewed and allow it to be overwritten but the data is still there and can be recovered through recovery apps or forensics.
Does TRIM prevent this?
Click to expand...
Click to collapse
It's a complicated question, each implementation is different. TRIM will tell controller the blocks are unused, not sure if anything else happens to them. Read some of this to get an idea:
Perform a SSD Secure Erase - Thomas-Krenn-Wiki-en
In this article, we will show you how to perform a secure erase on a SSD under Linux. By doing this, you can increase the performance of frequently used SSDs for future use. But, all of the data will be lost. For Fusion-io’s ioDrives, see Low-level Formatting a Fusion-io ioDrive.
www.thomas-krenn.com

I am going to post the actual command to activate this as there is nowhere I can find that has in even the repository. Even though the command is stated on the display, you still have to manually type it so here it is:
adb shell pm grant com.draco.mfstrim android.permission.WRITE_SECURE_SETTINGS
Enjoy

This app only adds a Global Table parameter called "fstrim_mandatory_interval", set to 1 if you choose every reboot. This is possible with SetEdit and ADB very easily (in 10 seconds) and it is permanent. I am a bit surprised that a whole app has been made only to set this one parameter. Also, the parameter is not effective on a lot of ROMs. If OP's app is paid, that is ridiculous; I sure hope it is not!
With magisk root, you can make a script that runs on every boot running fstrim through busybox. That's what I do, because this parameter used in the app is useless; automatic fstrim is not run on any MIUI ROM I have tried so far.
I have no idea why OP states it adds a Secure Table parameter; I have not seen such being added.
Note that these are my observations and could be wrong.

nosak said:
This app only adds a Global Table parameter called "fstrim_mandatory_interval", set to 1 if you choose every reboot. This is possible with SetEdit and ADB very easily (in 10 seconds) and it is permanent. I am a bit surprised that a whole app has been made only to set this one parameter. Also, the parameter is not effective on a lot of ROMs. If OP's app is paid, that is ridiculous; I sure hope it is not!
With magisk root, you can make a script that runs on every boot running fstrim through busybox. That's what I do, because this parameter used in the app is useless; automatic fstrim is not run on any MIUI ROM I have tried so far.
I have no idea why OP states it adds a Secure Table parameter; I have not seen such being added.
Note that these are my observations and could be wrong.
Click to expand...
Click to collapse
It's a free app. It's conveinient for those who don't want to remember the parameter or how to use SetEdit. Also nice to just be able to toggle on/off. It has worked for me on every Lineage-based ROM I've tried it.
Good to know that it doesn't work on MIUI ROMs however, and that there's a permanent method that doesn't require installation of an app!

Related

[Tool/App] user.conf Creator v0.4 for CM and OfficialDonut [8/12/2010]

Update: v0.4 has been released. See changelog in the next post.
You can download the app using the link below or from the Android Market. Click or scan the barcode below.
This is essentially a visual representation of the user.conf file. I created this app because a few people I know have a hard time pushing files in terminal or ADB. This app allows you to push user.conf and userinit.sh files via an app. For people who have trouble editing their user.conf file or find terminal or ADB too complicated, here's your answer. There is no need to edit the user.conf file or even download one for that matter. You simply enter the values into the various boxes and click a button. That's it.
Complete help documentation is included within the app itself so I will not include it here, at least not now.
Important Note: This app does NOT validate your input. Please use the threads below to find out what values are necessary for your particular ROM.
This app is based off the user.conf and userinit.sh files found in the following posts:
For Cyan 3.6.8+
http://forum.xda-developers.com/showthread.php?t=542899
For Cyan 4.1.99+
http://forum.xda-developers.com/showpost.php?p=4823045&postcount=536
For Official Donut 2.1.1+
http://forum.xda-developers.com/showthread.php?t=538456
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For the changelog, see the next post. Please keep this thread on topic. Do not post user.conf issues here. Post your user.conf issues to the proper thread using the links above. This app simply represents those user.conf/userinit.sh files. I will not change the structure of the files nor do I really know much about them. I am more than willing to answer questions regarding this app and hope to update it as needed.
********************************
Note: This may very well work on other devices. If someone can point me in the direction of user.conf and userinit.sh files for other devices I will add them to future versions of this app, time permitting.
********************************
This app is also in the Android Market.
After downloading, change the extension from .zip to .apk and install as you would any other non-Market app.
Changelog and TODO
Changelog
v0.4
• Added a bunch of different CPU frequencies, pretty much everything I found in SetCPU. I haven't tested this but since it just prints it to a user.conf file, it should work fine as long as the device supports the frequencies you set.
v0.3
• user.conf file actually gets pushed now. Big thanks to XDA forum member andrew richardson for pointing it out. Update above, in the Market and on SlideMe.org.
v0.2.1
• Name change to user.conf Creator (not user.conf Editor since you are only really creating the files, not editing them)
v0.2
• Added support for Cyan 3.6.8x+
• Added support for Official Donut
• Added option to backup you current file(s)
v0.1
• Initial release
TODO
• Add some seriously awesome validation.
• Add support for Hero ROMs (although untested,the Cyan 3.6.8x+ option should work)
• Add some presets
• Possibly look into making this an actual "editor" in that it will read your current user.conf file.
Looks like an extremely helpful app. Gonna check it out. I really only use linux swap so looks like i can focus on that and leave the default configurations for the other options, am i right?
This is a really good idea, and if you get the validation sorted, which you probably will, it will stop masses of people, including me stopping their whining. There will be little to no excuse of not being able to make your own user.conf, and I can see this being introduced to the big roms soon.
2leaponover1 said:
Looks like an extremely helpful app. Gonna check it out. I really only use linux swap so looks like i can focus on that and leave the default configurations for the other options, am i right?
Click to expand...
Click to collapse
Yes with a swappiness of 50.
AndroidAppCritic said:
Yes with a swappiness of 50.
Click to expand...
Click to collapse
Ok so I also only want to enable the linux-swap partition I have. I would just check the linux_swap_en correct? Then push file and reboot?
strikerz911 said:
Ok so I also only want to enable the linux-swap partition I have. I would just check the linux_swap_en correct? Then push file and reboot?
Click to expand...
Click to collapse
If you wanted to enable your linux-swap ONLY (with no other settings), simply open the app, select your ROM, push and reboot. By default, if you do nothing, the app will push a user.conf with linux-swap enable with a swappiness of 50 for Cyan 4.1.99+. Everything else is disabled (or rather, not enabled).
But like I said in the OP, any configuration issues should really be addressed in the proper thread since this is literally an exact copy of those files only with a GUI attached. While I have a pretty good understanding of the various settings, the people who write userinit.sh files know far more than I do.
Well, no issues here. =) Thanks for your immediate help. I appreciate it.
Would be nice if it could read our current settings.
bubonik said:
Would be nice if it could read our current settings.
Click to expand...
Click to collapse
Yeah, that was my original plan. But it's too much for me to do now. When my workload eases up at the end of December, perhaps I'll tackle that. I know how to do it but I just don't have the time now to write the code.
May I use it on any ROM or just on those three?
no user.conf
When I run the app it says it pushed the user.conf and the userinit.sh, but only the userinit shows up in the folder.
andrew richardson said:
When I run the app it says it pushed the user.conf and the userinit.sh, but only the userinit shows up in the folder.
Click to expand...
Click to collapse
I'll check it out.
EDIT: OMG. Hundreds of downloads and you're the first to notice that. WOW! I've been running an older version of the app so it's been working for me. I had commented out the lines in the code while testing something and never un-commented them. I am re-signed the package and will upload it here, in the Market and on SlideMe.org. Thanks for pointing out what should have been ridiculously obvious.
michal_banszel said:
May I use it on any ROM or just on those three?
Click to expand...
Click to collapse
It should work for other ROMs if they use the user.conf/userinit.sh files from the links provided in the OP. You can test for me if you wish and if there is a specific ROM for which you need support, let me know the ROM and where the user.conf/userinit.sh files are located and I will add it when I have time (not that I have much lately).
user.conf
yes i have a question.. i used your app and i pushed the files on the linux swap to 32 mb... so now when i type free in the terminal it reads
total used free
shared buffers
mem: 107100 104264 2836
0 652
swap: 31424 24944 6480
total: 138524 129208 9316
well the question that im asking is how can i turn the swap off back to 0..cuz before my swap read 31424 it read 0 across .. i really appreciate if i can get an answer .. thanks
AnGeL_WiT_SiNs said:
yes i have a question.. i used your app and i pushed the files on the linux swap to 32 mb... so now when i type free in the terminal it reads
total used free
shared buffers
mem: 107100 104264 2836
0 652
swap: 31424 24944 6480
total: 138524 129208 9316
well the question that im asking is how can i turn the swap off back to 0..cuz before my swap read 31424 it read 0 across .. i really appreciate if i can get an answer .. thanks
Click to expand...
Click to collapse
Are you asking how you can turn your linux-swap off? I'm having trouble understanding your question. If you want to turn the linux-swap off, uncheck all the linux-swap, compcache and swap file checkboxes and re-push the files.
Holy crap! I just got a new SD card (8GB Class 4) and set this up with the settings from the rist post and it SCREAMS!! Hopefully it will be stable with thtese settings. I am running Cyan 4.2.7.1 on G1.
Time for New release?
I am trying to use this with CM 4.2.13 to enable 32mb compcache + the backingswap feature (32mb swap partition). When I set the checkmarks for these items & pushed the file & rebooted my phone lagged really bad so I 'pulled' the files over to SD with the backup option & renamed to .txt so I could view in a notepad app rather then in terminal... low & behold the default app settings had been pushed, not my selected settings. I am wondering if something drastic has changed within CM that would mess with your file creation or what else could have caused this? (I am not leaving out human error on my part) I went into terminal & rm /system/sd/ user.conf & userinit.sh so i can try again clean. Please tell me you are still actively supporting this app! I love its potential for ease of use in manipulating these files.
Also I'm not sure what settings I should put in on compcache+backingswap, here is whats running on my phone...
I have (on my sig phone/SDcard/ROM) blackicedroid theme with stericson lockscreen & advanced launcher built in, 4 home screens,
Widgets : last.fm, myspace friend status, facebook status, Google Calandar, android power control bar, F*ck my life 1x4, three weather bug small (1x1)...
17 app shortcuts
Active background Apps : Twidroid, eBuddy (logged into 2 chat accnts), Craigsnotifica (15 regions being scanned).
~psguardian
i need a little help
Hey guys, I think your app is amazing dude. I'm fairly new the rooting my phone, I have done a lot of similar things in the past, but never involving a phone. I have a T-Mobile myTouch 3g, i love this phone, but i wanted to see what it could do. i work with other T-Mobile coworkers and many of them rooted using the CyogenMod. Today there was a bad snowstorm so i stayed in and rooted my myTouch. everything went great! i love this phone so much more, i cant believe it!
Anyway, i know i can over clock it. and i saw that the creator uses a myTouch so i figured I followed his photo settings in the first post. I want to over clock my phone to the best of its abilities but I don't really wanna push it TO its limits. I'm just wondering if basically those two settings scaling_min_freq and scaling_max_freq are what is going to control the processing speeds, and what is best in my case? I initially followed AndroidAppCritic's same values, but I lowered my max value to the 300K limit. Is that a ok? I mean, I'm guessing it lets my phone only really reach that max value when it needs to, but what does the minimum speed have much to do with it? I set mine to the same 245760, but should I lower this since I'm running a lower maximum frequency than 528000?
Thank you.
I can't update or install any apps, it says there isn't sufficient memory.
I have a G1 with cyanogenmod 4.2.14.1 with
apps2sd checked
compcache_en checked with 32 cc_disksize
cc_backingswap checked with 60 swappiness
I don't know what I'm doing wrong but help would be greatly apreciated. And also my swap partition is 128MB since I tried a rom that required that much and I decided to keep it like that but I'm pretty sure that's not the problem, is it?

RAM in Froyo: welcome to Hell

I have been using the latests builds to see if they mitigate a common problem in our devices (mine is a Polaris). The insufficient memory makes it lag until forever when switching amongst applications, not only the heavy ones, but also the supposed light applications like Messaging, Phone, Contacts, etc.
The system has to work under really hard conditions: 20 - 28 MB when starting up. Every application I run is a fire proof. Applications like Navigation makes our devices literally crawl and bite the dust. Not far away, I was driving and tried to play some music at the same time. It was impossible. The waiting was unbearable and it finally hung like a pro.
My question is: is there any chance to free up memory or use it more efficiently in order to avoid these undesirable situations?
Did polaris get back some memory with Froyo kernel like vogue did? From the video buffer or something... what res do you run at?
I'm running at 240x320 - 120 dpi
I made a screenshot of a "free" command in a terminal (see attachment image).
My kernel is this one (converted with Atools):
http://androidhtc.git.sourceforge.n...=2.6.32/VOGUIMG-320-FROYO-10-4-10.NBH;hb=HEAD
Thanks for your interest!
Im not sure.. but is there a way to use the sd as ram?
I think its not fast enough, but i havent seen any "benchmarks" yet how fast the ram on the polaris works.
Maby its slower but fast enough to work as swap etc?
Enabling compcache will help you.
Still, our little devices cannot multitask very well with Android, but I can navigate and play music at the same time, with compcache.
You will need drivers that match your kernel, in /system/lib/modules. I have packaged some in the first post of this thread that should work for each of the two popular kernel versions.
n2rjt said:
Enabling compcache will help you.
Still, our little devices cannot multitask very well with Android, but I can navigate and play music at the same time, with compcache.
You will need drivers that match your kernel, in /system/lib/modules. I have packaged some in the first post of this thread that should work for each of the two popular kernel versions.
Click to expand...
Click to collapse
Alright, I'm downloading the modules for 2.6.32. After applying the update, what should I do to enable compcache? Some time ago, this setting was in Spare Parts.
SuperJMN said:
Alright, I'm downloading the modules for 2.6.32. After applying the update, what should I do to enable compcache? Some time ago, this setting was in Spare Parts.
Click to expand...
Click to collapse
Open terminal
type: Su
and then
compcache.sh enable
-Arturo- said:
Open terminal
type: Su
and then
compcache.sh enable
Click to expand...
Click to collapse
any way to confirm that it worked?
margosmark said:
any way to confirm that it worked?
Click to expand...
Click to collapse
type FREE in terminal and look under swap if it shows zero then it's not active.
-Arturo- said:
type FREE in terminal and look under swap if it shows zero then it's not active.
Click to expand...
Click to collapse
yea, try doing free from a terminal you should have an amount of memory for the swap row
For testing...
Thank you SuperJMN for this thread : I hope this help us for better use of our phone.
Like you, when I try to use my GPS navigation (Navigon or Igo8) I'm bored that's too slow !! Impossible to change anything if I want...
I try now with Compcache enable, I can see 130024 (total and 104156 used) instead of 104024 : swap = 26000
Cheers.
manu33xtro said:
Thank you SuperJMN for this thread : I hope this help us for better use of our phone.
Like you, when I try to use my GPS navigation (Navigon or Igo8) I'm bored that's too slow !! Impossible to change anything if I want...
I try now with Compcache enable, I can see 130024 (total and 104156 used) instead of 104024 : swap = 26000
Cheers.
Click to expand...
Click to collapse
any better luck with comcache on??
Report
I installed this update for my .32 kernel (dated September, the 30th):
http://forum.xda-developers.com/attachment.php?attachmentid=409422&d=1285714954
My build is the latest: http://sourceforge.net/projects/androidhtc/files/system-froyo-01-10-10_16.tgz/download
When I open a terminal and type
su
compcache.sh enable
it states that compcache will be enable in 120 seconds.
After that time, a free command doesn't reveal any change.
I've also tried typing
su
compcache.sh start
When doing this, it processes the command and after 30 seconds or so, some lines are displayed:
Code:
insmod: can't insert '/system/lib/modules/lzo_compress.ko': File exist
insmod: can't insert '/system/lib/modules/lzo_decompress.ko': File exist
insmod: can't insert '/system/lib/modules/ramzswap_compress.ko': File exist
swapon: /dev/block/ramzswap0: Function not implemented
vm.swappiness = 30
After that, a free command doesn't reveal any change, too.
SuperJMN said:
I installed this update for my .32 kernel (dated September, the 30th):
http://forum.xda-developers.com/attachment.php?attachmentid=409422&d=1285714954
My build is the latest: http://sourceforge.net/projects/androidhtc/files/system-froyo-01-10-10_16.tgz/download
When I open a terminal and type
su
compcache.sh enable
it states that compcache will be enable in 120 seconds.
After that time, a free command doesn't reveal any change.
I've also tried typing
su
compcache.sh start
When doing this, it processes the command and after 30 seconds or so, some lines are displayed:
Code:
insmod: can't insert '/system/lib/modules/lzo_compress.ko': File exist
insmod: can't insert '/system/lib/modules/lzo_decompress.ko': File exist
insmod: can't insert '/system/lib/modules/ramzswap_compress.ko': File exist
swapon: /dev/block/ramzswap0: Function not implemented
vm.swappiness = 30
After that, a free command doesn't reveal any change, too.
Click to expand...
Click to collapse
Try this one
http://dl.dropbox.com/u/7688082/androidupdate.tar
Also is terminal added to the white list in super user app.?
Try with this update...
l1q1d said:
Try with this update...
Click to expand...
Click to collapse
It worked! Thanks!
By the way, the touchscreen behaves erratically with 4-oct NBH. Test with calibration app and tap the screen. You will notice abrupt lines.
Edit: if you want to see which behavior I'm referring to, watch this video: http://www.youtube.com/watch?v=DPLu41BUB1Y
It happened sometime in the past, but with this one it happens the same (although the abruptness is not as much as in this video).
Edit 2: Strangely enough, it is fixed on reboot, but after some time running the touchscreen starts to behave crappy again. It happens with the newest .NBHs made in October.

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] Swap Torpedo - run faster and more reliably

Using compressed RAM for swap on a phone with enough RAM in the first place sucks.
Let's take a look using RAM Truth from the Play Store -
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
It makes no sense to use 500 MB of swap with 3 GB RAM free!
If yours already looks like the second picture, 0 swap, you're done, you don't need this module.
(Note - we're going to update RAM Truth - the swap type used on the honor is zram.)
But if you need to get rid of swap, here you go -
Swap Torpedo - A Magisk Module
Universal compressed-memory swap (zram, etc etc) destroyer - run faster and more reliably!
By EarlyMon - version 1.1
Swap is a way to expand your RAM using clever software and some unused storage space. You see it a lot in Android as zram or vmswap, that is, compressed-memory swap. Storage-based swap is fine, compressed-memory swap - not so much.
Swap is a fine thing for desktops with sufficient resources and for Android devices really hampered with too little ram.
On Android it was originally intended for devices with less than 1 GB RAM.
If you have an Android One or another small-memory device, this is NOT the module for you.
But if you have 2 GB of RAM or more, you want this.
Do you suffer from lag, random UI pauses, apps not running correctly and consistently, and background apps failing even when you have them marked for protection? Do you have to reboot every day or so to restore speed?
All of that is almost always caused by having swap implemented and the Swap Torpedo fixes it.
Manufacturers, including Google, have fallen in love with compressed-memory swap because it allows your Android to synthetically appear better at multitasking. In reality, it ruins multitasking.
Why? For large memory devices you want the swap space to be at minimum the square root of your RAM size and ideally the same size as, or up to double the size of, your RAM.
The problem is that they don't use enough space because they can't - they're basically using a compressed RAM disk as a swap partition.
If you think about that, it will raise the right questions.
Does it make sense to use RAM for something other than apps and the operating system? Does it make sense to constantly have the operating system pause while it shuffles and reorganizes your RAM? Does it make sense for you to wait on everything while various pieces of RAM are getting zipped and unzipped to support this scheme? Does it make sense to do all of that incorrectly in the first place because you can't get enough swap space to properly support multitasking, by design?
No. No it does not.
Swap Torpedo is the answer.
I designed it to be universal for any Android that Magisk version 15 and above supports. If you're not using swap, or if you installed your own swap solution that writes to a special file in storage, Swap Torpedo harmlessly does nothing.
Verify your swap situation with RAM Truth available on the Play Store. It's free and it will never spy on you or ask for special permissions.
Donations are humbly and gratefully received at [email protected] but not expected. My personal reward is knowing that I helped and you are having a better day now.
This module was developed entirely on an honor View 10.
Notes -
Some phones may need a few minutes after boot to clean up swap/zram - not all, just some - and that's completely normal
May not work on all devices but will probably work for you - ask here for help
Changelog -
(early change) 2018 April 27
Increased initial maximum wait time to 60 seconds. Your additional boot time will be about 3 seconds or so, usually less.
v1.1 - 2018 April 1 - functional improvement
Detached background processing, added Pixel and similar support.
Expanded zram command sequence for devices requiring stricter adherence to the rtfm.
Waits up to 45 seconds for swap to activate, expands support for non-flagship phones.
v1.0 - 2018 March 17 - initial release
Download -
Beta versions are exactly that so you may have trouble with Magisk 16.4 for example (or you may be ok) - please let me know, thanks!
Check out the v1.1 release at bottom of the first post above
Open Source -
https://github.com/Magisk-Modules-Repo/swap-torpedo
Just because it's open source does not mean that you ought to avoid giving me a few million dollars if you happen to be a billionaire. Let's face it, Swap Torpedo just made your life a lot better than the last guy you gave serious money to, and plus you'll have me in your corner verifying that regular billionaires such as yourself do too root and use Magisk. Trust me, the other billionaires will be so jealous they won't know whether to die or go bowling.
I hope that this clarifies the importance of open source software once and for all.
Thanks and Credits -
Nitin Gupta because real information comes in Courier, plain text or it didn't happen
@topjohnwu because in my mind I was totally going to invent Magisk first... OK don't be insane, I'm just kidding - Doctor Wu by Steely Dan is a great song and I'm not sure but I don't think it has anything to do with Magisk, no one really knows for sure - Magisk is great, mmmkay, thanks John
Special thanks to all of the heroes named by @topjohnwu and the unnamed ones as well. My people have an ancient saying that applies here - Without you, we'd be screwed!
Thanks to everyone in the thread who worked with me to help make Swap Torpedo better
Thanks to every one of you using the Swap Torpedo - I get that you get it
Finally, I thank my wife - she had nothing to do with Swap Torpedo but probably someday she'll say that I'm not grateful and I'm going to show her this special credit - I'm sure that will go really well for me, how about you?
Other Stuff -
Official module, 2018-3-26.
There's a shortcoming in RAM Truth that throws off the illustration in the first post - it misidentifies the swap type on Oreo and when vmswap is used. We're looking into that. If it says that your Android is using swap and you didn't put it there, Swap Torpedo is for you.
Secrets About Swap Torpedo -
Runs swapoff on every /dev entry in /proc/swap(s) during late boot. Making it universal may be harder than you think. Or not, I couldn't say.
That's it. Nothing else is left running from Swap Torpedo once the payload is delivered, nothing else is changed.
Your Android runs fewer processes and is slimmer and trimmer if you needed it (and you probably do) thanks to Swap Torpedo.
Uninstall the module and it will be as if it was never there. Swap Torpedo targets each boot session.
No more, no less.
A Quote -
EarlyMon said:
Use whatever works!
Swap Torpedo has no pixie dust nor do I expect it to ever get any.
I've had to redevelop this solution for years, every time I or a friend got a new phone saddled with swap.
I made this module so I could stop reinventing the wheel and so that it would be easier for others to enjoy the benefits.
If you have something already that gets rid of swap, or if the Swap Torpedo doesn't work for you, definitely use the other instead.
Check out "EX Kernel Manager"
https://play.google.com/store/apps/details?id=flar2.exkernelmanager
Check out "Kernel Adiutor (ROOT)"
https://play.google.com/store/apps/details?id=com.grarak.kerneladiutor
Click to expand...
Click to collapse
Thanks! Will check it out and report back after using it a bit.
Do I need this if I have Adaptive LMK and ZRAM disabled?
Sent from my HTC 10 using XDA Labs
Megan said:
Do I need this if I have Adaptive LMK and ZRAM disabled?
Click to expand...
Click to collapse
Nope.
The Swap Torpedo will check and discover that zram is disabled and exit without doing anything else in your case.
I'll wait until stable release
hoping this project grows. will watch this till end
---------- Post added at 03:29 PM ---------- Previous post was at 03:23 PM ----------
i got another phone with 500mb ram. This module will work as it says originally intended for 1gb ram below.
It runing ??
How to check this module is works.
lanserffnt said:
It runing ??
How to check this module is works.
Click to expand...
Click to collapse
That's how to check.
Did it reboot after installation?
Please show me what it says when you type in a terminal, as root -
Code:
cat /proc/swap*
Yes reboot after installed
lanserffnt said:
Yes reboot after installed
Click to expand...
Click to collapse
Please uninstall and try this test version, thanks.
(removed asus test module)
Which version of Magisk are you using?
Magisk 16.2
lanserffnt said:
Magisk 16.2
Click to expand...
Click to collapse
I haven't tested with the beta Magisk, highest I've gone is 16.
Did you try the new test version (linked above) yet?
If that doesn't work, have you installed the busybox-ndk?
I try it test3
Have install busyboxndk
Magisk 16.2
https://forum.xda-developers.com/apps/magisk/beta-magisk-v13-0-0980cb6-t3618589
lanserffnt said:
I try it test3
Have install busyboxndk
Magisk 16.2
Click to expand...
Click to collapse
I've had another user report that it works correctly with 16.2 so it must be something with the ASUS.
I use zenfone3
If It's work should show??
Pixel 2 P DP1 freezes on boot at the Google logo
Any pixel 2 xl?
Enviado desde mi Pixel 2 XL mediante Tapatalk
lanserffnt said:
I use zenfone3
If It's work should show??
Click to expand...
Click to collapse
0 swap, like the second picture in the first post.
Telperion said:
Pixel 2 P DP1 freezes on boot at the Google logo
Click to expand...
Click to collapse
That's unusual. May I ask what other modules you are using and what other modifications, if any?
And you used the one in the first post?
What should it show in terminal?
I am using it on LG G4 v29 (Nougat beta) and it doesn't show anything when I write "cat /proc/swap*". :/

[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