[APP] LagFix (fstrim) v1.5.1 2013.03.04

Did LagFix work on your Android 2.x device?


  • Total voters
    118
  • Poll closed .
Search This thread

adwinp

Senior Member
Jun 22, 2008
2,055
330
urandom
Good job, although TRIM should only be used with SSDs.
eMMC 4.5 brings forth "discard", which is, I quote: "A variant of the TRIM command that is more memory technology friendly".
That is achieved by sending CMDs 35, 36 & 38.
Have a look at the jedec eMMC specification for details.
 

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
Good job, although TRIM should only be used with SSDs.
eMMC 4.5 brings forth "discard", which is, I quote: "A variant of the TRIM command that is more memory technology friendly".
That is achieved by sending CMDs 35, 36 & 38.
Have a look at the jedec eMMC specification for details.


Thanks for info! I will read tech docs this weekend.
 

markop90

Senior Member
Feb 16, 2011
443
113
R: [APP] LagFix for Nexus 7 & HTC One X

Good job, although TRIM should only be used with SSDs.
eMMC 4.5 brings forth "discard", which is, I quote: "A variant of the TRIM command that is more memory technology friendly".
That is achieved by sending CMDs 35, 36 & 38.
Have a look at the jedec eMMC specification for details.

With discard mount option problem is not totally fixed, performance decreases also with it.

You're my hero! Good job! It works nice on galaxy nexus

An idea for a future version: weekly cronjobs :)
 
Last edited:

chrone

Senior Member
May 5, 2012
1,050
369
Surabaya
Ads are from AdMob and TapForTap. They are simple banners, they are active only when you see them while using app. There is NO any crap like AirPush or other intrusive bs. Ads can be easily blocked with AdFree/AdBlock apps.

very well put. great! :)


Good job, although TRIM should only be used with SSDs.
eMMC 4.5 brings forth "discard", which is, I quote: "A variant of the TRIM command that is more memory technology friendly".
That is achieved by sending CMDs 35, 36 & 38.
Have a look at the jedec eMMC specification for details.

Here's hoping more advance ssd controller and nand chip high performance on future android phone. :D


With discard mount option problem is not totally fixed, performance decreases also with it.

You're my hero! Good job! It works nice on galaxy nexus

An idea for a future version: weekly cronjobs :)

glad you make it here, markop90! :D
 
  • Like
Reactions: markop90

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
So I've read some docs while travelling to work. Now I better understand the process, will dig further this weekend, expect an update. I think I also found a guy who will help me with paid version for those of you who can't stand ads and want to donate me some money (no one clicked any banners yet...). Hope update will make your life even better and easier!
 

chrone

Senior Member
May 5, 2012
1,050
369
Surabaya
So I've read some docs while travelling to work. Now I better understand the process, will dig further this weekend, expect an update. I think I also found a guy who will help me with paid version for those of you who can't stand ads and want to donate me some money (no one clicked any banners yet...). Hope update will make your life even better and easier!

looking forward for the update too. paid version with no ads and weekly cronjob, yay! :cowboy:
 

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
looking forward for the update too. paid version with no ads and weekly cronjob, yay! :cowboy:

I hope so :) Google does not like European countries for unknown reasons... Me and my friends are developing some games now and we were searching for publishing options for three months. This just drives me crazy already... Hate bureaucracy!
 

knitler

Senior Member
Nov 30, 2012
886
159
Philadelphia
If it doesn't work on Sense ROMs how can it work on the one X and One X+? it comes with sense form HTC.

EDIT: Works fine on my One X+ with stock ROM.
 
Last edited:

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
If it doesn't work on Sense ROMs how can it work on the one X and One X+? it comes with sense form HTC.

EDIT: Works fine on my One X+ with stock ROM.

I'm using CyanogenMod on my HOX. I've used it on all my previous devices and will use it in the future. It looks like some custom ROMs based off Sense require ROOT rights to run chmod command which is essential to make fstrim linux binary a runnable executable. So next update will bring chmod through su and that will fix the issue. su chmod was tested by AlexNone and reported working on these ROMs.
 
  • Like
Reactions: chrone

emd2009

Senior Member
Jun 3, 2007
739
91
I am running AOKP 4.1.2 with Franco #300 on toroplus and I got FC's after I run data and cache; however if I just run cache, it works fine.
 

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
Re: [APP] LagFix for Nexus 7 & HTC One X

Is there any way this would work on 2.3.4? I'm having this issue with an Atrix running an older version of Android.

http://xdaforums.com/showthread.php?p=36258006#post36258006

I've tried to install and of course its only 4.0+ :(

I guess the issue is fstrim isn't supported by default, and I don't have a C++ compiler on my phone :\

Next version will support earlier Androids. I thought it was N7/HOX issue only. Just wait another day, I'm busy improving after all feedback received :)

Sent from my Nexus 7 using Tapatalk HD
 
  • Like
Reactions: chrone and Dunc001

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
Update is published! It will take few hours to be processed by market, so stand by. Changelog:

v1.1
* Fixed chmod not working on some custom Sense ROMs.
* Added Android 2.2+ support.
* Fixed crashes.
* App is now multi-threaded.
* Updated UI a bit.
* New icon.
* App is renamed.
 

dosmac

Member
Jul 20, 2009
35
2
Update is published! It will take few hours to be processed by market, so stand by. Changelog:

v1.1
* Fixed chmod not working on some custom Sense ROMs.
* Added Android 2.2+ support.
* Fixed crashes.
* App is now multi-threaded.
* Updated UI a bit.
* New icon.
* App is renamed.

I am getting an error when I run the app:

# ./fstrim -v /data
./fstrim -v /data
fstrim: FSTRIM: Not a typewriter

# ./fstrim -v /cache
./fstrim -v /cache
fstrim: FSTRIM: Not a typewriter

That's from trying to invoke via adb shell fstrim, it prints the commands to run but errors when ran. Same from in-app the console prints fstrim -v /data then that error Not a typewriter!
 
Last edited:

AuxLV

Senior Member
Apr 30, 2009
435
729
39
Riga
I am getting an error when I run the app:

# ./fstrim -v /data
./fstrim -v /data
fstrim: FSTRIM: Not a typewriter

# ./fstrim -v /cache
./fstrim -v /cache
fstrim: FSTRIM: Not a typewriter

That's from trying to invoke via adb shell fstrim, it prints the commands to run but errors when ran. Same from in-app the console prints fstrim -v /data then that error Not a typewriter!

This is a response from your memory controller. Looks like you don't need this app - trimming is not supported. Which device do you have?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 207
    THIS APP REQUIRES ROOT!

    READ FAQ! Read that FAQ BEFORE you try app!

    Premium version is now ON SALE! -50% off of the price! Enjoy!

    Some Android users suffer from poor performance after some days/weeks of heavy usage. This is due to a well-known TRIM bug affecting these devices (there are reports that some Galaxy Nexus devices also have affected memory chips). Users with -discard mount option are NOT affected!

    The source of the problem is that internal storage is not properly TRIMmed when needed. You can find lots of information on XDA - http://xdaforums.com/showthread.php?t=1971852 and http://xdaforums.com/showthread.php?t=1929021 for example. It is also well-known fact that running fstrim Linux tool from time to time fixes the issue until internal memory runs out of free blocks. Other solutions like mounting with -discard or disabling fsync may be slow or dangerous.

    LagFix is a user-friendly implementation of fstrim utility. It allows you to select which partitions to trim (you should leave defaults unless you know what you are doing) and run the process easily.

    Please note that fstrim output depends on kernel and device. It works fine unless you see errors. You might see big amounts of bytes, zero amount or repeating amount. All are fine! Read fstrim manual to understand why all these outputs are valid.

    It is also advised to reboot your device after the TRIM process so that kernel could reinitialize block data.

    There are two versions of LagFix:
    1. Premium version (v1.5.1) - no ads + ability to auto-run trimming on specified schedule. The best choise!
    2. Free version (v1.5.1) - trims your memory with one click, has ads, no schedule.

    Warning! Premium version comes from different publisher! This is because Google does not allow to publish paid apps from my country. Send your rage to Google :) Both versions are legit, don't worry.

    Release notes:

    v1.5.1
    + Added CWM SuperUser support;
    + Added android.permission.ACCESS_SUPERUSER permission;
    * Fixed disabling scheduler;
    + New notification icons.

    v1.5
    Full rewrite, dropped RootTools lib, made my own. No more problems!

    v1.4
    + Device compatability detection is now completely reworked
    * Fixed a crash

    Earlier changelogs:

    v1.3
    + New UI
    + Added Info screen
    + Added device compatability detection (looks like it should be improved further)
    + Renamed Donate version to Premium
    * Fixed scheduling dissappear after reboot (Premium version)
    * Some other bug fixes

    v1.2 premium
    * Added auto-trim functionality which runs on specified schedule. Click Schedule button and you'll see the options. Setup the way you want and click Install. The button will change to Uninstall to remove auto-trim if needed.
    * Added detection if your device supports TRIM - run it once and you will know.
    * Fixed some bugs.

    v1.1
    * Fixed chmod not working on some custom Sense ROMs.
    * Added Android 2.2+ support.
    * Fixed crashes.
    * App is now multi-threaded.
    * Updated UI a bit.
    * New icon.
    * App is renamed.


    P.S. If your ROM mounts /data with -discard then this app is NOT needed!

    P.P.S. Free version is now attached for those, who do not have market for some reasons.
    72
    FAQ

    WARNING!
    There are some devices affected by BrickBug. Samsung Galaxy S2 and Samsung Galaxy Note are known to have it. There are also reports that some Acer A210/A211 and LG O2x are affected too. There is a Got Brickbug? app to test your device, but it is only intended for Samsung users. BrickBug means DEATH of your device if you try LagFix! There are some unlucky guys already. In case of brickbug - use warranty and exchange your device. This is a hardware fault and manufacturer is responsible.

    I provide NO WARRANTIES for LagFix app! Use it on your own risk.

    LG O2x brickbug may be recovered following this great tutorial by fifi139.

    What does LagFix do?
    It calls fstrim utility, which calls ioctl operation called TRIM, TRIM does the magic.

    What is fstrim?
    fstrim is a Linux utility to call TRIM on your memory devices. You can find more information about it and source code at SourceForge. It is now a part of util-linux and can be found inside Linux kernel repository.

    What is ioctl?
    This is a programming interface to talk to storage devices directly in UNIX opearting systems. It is called DeviceIoControl in Windows. It allows to do a lot of low-level things on different storage devices like hard drives, CD-ROMs, flash memory and SSD drives.

    What is TRIM?
    TRIM is a low-level function, which informs memory controller of unused memory block. This is used on most of SSD drives and some eMMC memory. SD cards use different function - SD ERASE. Read more in Wikipedia.

    Why the lags?
    Devices with TRIM support must be trimmed to know which parts of memory is free and is available to write more data. When memory controller does not know which parts are free, it starts the search asking operating system to help it. This process will take time and the less free space available, the more time is required. And this operation blocks everything else. So everything you do starts to wait (lag) when some data needs to be written. For example, when you switch apps, the state of previously used app is saved to internal memory so you could get back to it when needed. Saving = lags. Simple!

    Which devices are affected?
    It is known by now, that Nexus S, Galaxy Nexus, Nexus 7, Nexus 4, Nexus 10 and HTC One X need regular trimming. It is also believed that all pre-ICS devices used different memory and they do NOT need it nor support it. Pre-ICS support will be dropped in version 1.2. Other 4.0+ devices? Well, test it! And report if it really helps - your device will be added to the list.

    How to properly test it?
    Use AndroBench app before using LagFix and after. You only need micro test. Look for Sequential Write values. Reading from memory is NOT affected, because reading does not involve writting and only writting triggers search party for free memory blocks.

    Why to reboot?
    Most of the users DO NOT need rebooting after trimming. But SOME RARE kernels do not re-initialize free block information after TRIM. It is impossible to detect such kernels, so if LagFix did something but IO related lags did not go away - reboot! Most of users DO NOT need rebooting!

    My device is in the affected list, but LagFix does nothing.
    Some kernels mount storage with -discard option. This option forces kernel to call TRIM operation after all write and delete operations. That means that functionality of this app is built-in, you don't need LagFix in such case.

    Why not every kernel comes with -discard?
    Discard slows down write operations a bit and delete operations a lot. Desktop Linux users NEVER use it, instead they put fstrim in cron to run once per day. Scheduled launching of LagFix is comming in version 1.2.

    LagFix is not available for my device in Play Market, why?
    It was reported by many users that your device does NOT support TRIM operation. You don't need this app, it will NOT do anything on your device.
    6
    Works with S4 (i9505) if anybody's wondering

    Trimmed /system, /data and /cache a few times over the past few days and haven't run into any problems

    Sent from my :tank:
    6
    hi..
    does this app fix the problem permanently?
    or this problem will be back? if the problem will be back, how long the problem will back since we use this app?

    one more question..
    is this perfomance issue hardware of software issue? thanks :)

    Memory should be trimmed regularly. It will be back as soon as you write some new files. It depends on how often you write new data to /data partition. I personally trim my phone once a week.

    The thing is that trimming is needed on all solid memory types, but different memory types uses different mechanisms for trimming. For example, SD cards use function called SD_ERASE and it is automatically called when needed by all known to me operating systems. Newer eMMC chips use TRIM function like in SSD drives. Desktop OSes call TRIM on a regular basis, like once per day or so. This includes desktop Linux. But Google devs forgot about it for some reason. So it can be called a software "bug" by Google/HW vendors.

    What I did? I took fstrim app from desktop Linux, cross-compiled it for Android and packed inside nice looking app :) I'm also preparing patches for CyanogenMod so that fstrim would be included for devices with such eMMC chips and run automatically like it does on desktop systems. But I need to spend some time understanding how Android and CM works and where to put it correctly. And how to submit patches and so on, so bear with me.
    6
    is there any update for fstrim coming out?

    Yes, bug fixes this weekend.

    Sent from my HTC One X using Tapatalk 2