[General Topics] jen.magnolis:
In this thread I want to share my thoughts and experiences on how to optimize storage and memory for a phone with low internal memory and with access to an SD card, for example like the LG G4S (model H735) with only 8GB internal memory and 1.5GB RAM.

I'm happy to hear more suggestions to optimize!

First of all, you need to root your phone. Find out how to do this for your individual model.

Once you're rooted, you can optimize your storage and memory:

Get a good SD card with fast read and write speeds! This is crucial as you're going to be running lots of apps from it. Get a 32GB (or if your phone supports more, then more!).

You should partition your SD card so that you can make a second partition with the ext4 file system used by Android. Only then will you be able to move almost all your apps to SD! See notes below on how to partition your SD card.

You can now use the excellent Link2SD app to do all of the cleaning tasks:

Moving & linking apps & data to SD

Uninstall system apps

By default, you will only be able to move the "user" apps (the ones which were not installed as part of the system, e.g. the ones you installed yourself). But we can get around this with many apps! This is described below (in 4.).

You may have noticed that when you switch between apps, e.g. between your game and your messaging app, every time you switch, the app reloads (e.g. the game takes ages to start up again). This is because your RAM (main memory) usage is not optimized. You can also do something which is likely fix this, which I will describe below (in 5.).

1. A word about data usage of an app

You may have wondered why your memory usage is still so high when you moved your app to an SD card with the classic Android "Move to SD" functionality (which you can access via the Android app settings).

Well, the classic Android "Move to SD" only moves the app. But often the bulk of the data is actually not in the app itself, but in the data and OBB files of the app! In games, this can be up to several gigabytes. And this stuff remains on your internal storage! So we will need to move this as well, and then "link" to the moved data, so the Android OS "believes" that the data is still on internal storage. Imagine this similar to doing a (soft)link to a file on your computer.

Also, doing it this way ("linking") is much better than the classic Android move-apps. For example, you can avoid problems with widgets which may not run any more once they have been moved to SD with Android move-apps.

There are a few apps which can help you move&link your apps and data. I have tried a few, and in my opinion Link2SD is the best, as it

already detects if your app uses OBB and data files

you can easily display the apps which use most storage (also in terms of data files!)

and you can also uninstall system apps more reliably than with other root apps!

You will need to get the pro version in order to do everything with it, but this is $2 well worth spending, you won't need any other apps for managing the moving. It's much easier than e.g. FolderMount to easily move all the relevant data of an app to SD.

2. The partitions on your phone

Most likely, your phone will be using different partitions on the internal storage for different purposes. For example, there may be a partition which is exclusively to be used for the "system" (the Android OS and system applications).

You can use an app like Disk Info to show the partitions on your internal storage (and SD card) and how much space is still free on them.

This may vary between phones, but in most cases you should find a "data" partition or similar, which is used for

Applications installed by you

Updates of system apps (!!!)

Data, Cache, OBB files etc. used by your apps

The size of this data partition is pretty much what you can get out of your internal storage: if you move everything out of there, this is the maximum free space you can get (again, it may vary from phone to phone). You cannot easily get access to the system and cache partition to use as storage space, and you shouldn't try to mess with that anyway.

So what you can try to do, is shove as much as possible out of the data partition onto your SD card. The free space on data can then be used as a "buffer" when you download and install applications, before you move&link them onto the SD card.

Note also that your data partition is used for updates which may have been automatically downloaded. This may take up a significant chunk of your data partition! So you may want to either:

Move the whole system app to SD card (see below described for Link2SD).

Or, "merge" the updates into the main app, so that it then resides on the system partition again.

To merge the update with the main app, long-tap (tap and hold) on the app in Link2SD and select Integrate app into system. However keep an eye on the free disk space on the system partition, you don't want it to get too close to using full capacity! So only merge updates when you're sure there is enough free space on /system.

3. Partition your SD card

It is important that you create a second partition on your SD card, formatted with the ext4 file system used by Android. Only then will you be able to move all apps completely onto SD.

On Windows, you can use Mini Tool Partition Wizard to partition your SD card and format the second partition as ext4. I won't go into detailed instructions here, there's other documentation for this on-line.

Only a few notes:

It is important that you format the ext4 partition as "primary" also!!!

You can also "resize" the first partition (the FAT32 which may already be on it), without losing your data. However if something goes wrong, you may lose the data anyway, so it's advisable to backup your data on the SD card before.

You may want to keep a FAT32 partition (also formatted as primary), because on windows systems you cannot easily read ext4, so you may want to use the FAT partition to store your pictures etc., which you can then also read from a Windows computer.

4. Use Link2SD to move your apps

Open Link2SD and you will see a list of your apps. On the top bar you can select to display only apps of certain types, e.g. "user" and "system" apps. And you can also sort them according to different criteria, e.g. "Name" or "Size". I often use "Size (total)" in the bottom of the sorting criteria list. This shows the apps which use the most data overall first.

First, we will move the "user" apps to SD.

Display all the "user" apps and click on the first one you want to move & link to SD.

You will see a detailed list of your app and data usage.

You will see buttons to Link to SD card or Remove link. Below this, you see a field titled Android App2SD in which you can Move to SD Card --- this is the classic Android way to move apps: don't use this! Use Link to SD Card instead

After selecting Link to SD card , you can tick the boxes for everything you would like to move (app/cache/internal data...), and then click OK. Link2SD will move all your stuff to the ext4 partition of your SD card and then also link to it.

The apps which also use OBB files and extra data/cache will display extra boxes in Link2SD. Try a game app for example to see this, large games are likely to use this. You can click Link to SD for these extra files also, and it'll be all moved to your SD! Warning: I've had problems particularly with moving OBB files, sometimes also with data files -- the app was not launching properly after I've moved the OBBs. This is not the fault of Link2SD though, I've had the same problems with other apps like for example FolderMount.

If you want to undo the linking, just use Link2SD and select Remove Link. All your data will be moved back to internal storage, and the link will be removed. All back to how it was before. Easy!

Now you may also want to move system apps to SD to create even more space. While system apps natively reside on the /system partition (see 2. above), they also may store data and cache on the /data partition. Or, you may also want to create more space in the /system partition by moving system apps to SD.

The problem is, even though you are rooted, you cannot move the system apps. And for many of the system apps, you shouldn't do this either. However, it is safe to do this for apps which are installed as "system" but not really an integral part of the OS, such as

Chrome

Google maps

Google docs

Google drive

YouTube

and more.

To move them, you can use Link2SD to convert them from "system" app to "user" app.

Open Link2SD and long-tap (tap and hold) on the app to open the options menu. If you have a Convert to user app option, that's that!

If you don't have the conversion option, you can try something else:

Uninstall the app first by long-tapping on the app in Link2SD, and selecting Uninstall. But first make sure you will be able to download this app from Google Play!

You will need to reboot the phone.

Re-install the app from Google Play.

Now, you can use Link2SD to link the app to SD as we did for the user apps before.

Important: Never to this for core system apps, and I would also not touch Google Play or any of its services.

Note: You may also consider to just merge the updates of a system app so that it resides in the /system partition again. See description above (2.) for more details.

5. Optimizing your RAM

What I found particularly annoying on my LG G4S (H735) is that whenever I switched between my game (large files) and another app (e.g. messaging app), the game would load up from scratch again, which would take a few minutes. The reason for this is that the default settings on the phone were set to keep a too big part of the memory "free", so other apps were "killed" as soon as I was using my game. When I then switched back to home screen, all the other apps had to be re-launched, and my game instead "killed" again.

You can decrease the threshold of reserved free memory by editing the build props. There's a risk to get an unstable system if you tweak this too much, but if you try carefully, it may be ok. And you can also reset it to defaults if you're not happy with the results.

You will need a build prop editor, for example the Build Prop Editor app. Open it, and click on the "edit" pencil below to edit the following values:

ro.sys.fw.mOomMinFree1=...

ro.sys.fw.mOomMinFree2=...

ro.sys.fw.mOomMinFree3=...

ro.sys.fw.mOomMinFree4=...

ro.sys.fw.mOomMinFree5=...

ro.sys.fw.mOomMinFree6=...

It worked like a treat on my phone (LG G4S with 1.5GB RAM) and was also reported to work nicely with the LG G3, using the following values:

ro.sys.fw.mOomMinFree1=49152 (unchanged)

ro.sys.fw.mOomMinFree2=61440 (unchanged)

ro.sys.fw.mOomMinFree3=65000 (was set to 73728 originally)

ro.sys.fw.mOomMinFree4=70000 (was set to 204800 originally)

ro.sys.fw.mOomMinFree5=80000 (was set to 262144 originally)

ro.sys.fw.mOomMinFree6=100000 (was set to 327680 originally)

Please share your experiences if you have some tipps to further optimize low-memory phones! Thanks :)

See also

http://forums.androidcentral.com/lg...ry-using-link2sd-w-pros-cons-vs-data2ext.html

http://www.link2sd.info/faq