Kodi Community Forum

Full Version: [BUG] Kodi wastes internal flash space incorrectly used
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Today I've tried to install Kodi 14.2 on my 'Lenovo IdeaPad A10' Android laptop, without wasting too much of its internal flash storage.
But due to a bug in Kodi's use of cache storage, this has proven impossible.

Background:
This laptop has a small SSD, split into partitions of which two are accessible.
1 GiB is used for the 'Internal Storage' (The place for all system data and default place for installed apps)
12 GiB is used for the 'Nand Flash' area, also linked as "/sdcard" (The preferred place for moving apps to)
I also have a 64GB SDXC card linked as "/mnt/external_sd", but this is not involved in my current problem.
Btw: I know that many tablets have a similar storage scheme (I have one such myself too)

From scratch the 1GB area is more than half consumed by system-bundled apps and their updates+data.
And almost every user-added app will also consume some space of this area. (Even when the app itself is moved elsewhere.)
Before the Kodi installation I had a grand total of 255 MB free space in that area, so additional losses must be minimized.
But just installation of Kodi consumes 60 MB of this area, and first run consumes an additional 78 MB (and that is the main problem).

My system is rooted (using KingoRoot) and I have successfully used the "System App Remover" from Google Play to move the installed Kodi app from the 1 GB 'internal' area to the 12 GB area, so the space for the app itself is no longer a problem. But its data storage is a major problem.

I used the method of creating the file "/sdcard/xbmc_env.properties" with content "xbmc.data=/sdcard/kodi_data", and also created that "kodi_data" folder in "/sdcard".
After this, and cleaning all old storage of Kodi, I've restarted it and seen that it does fill the "kodi_data" folder with the expected subfolder structure.
Surprisingly though, the content of that folder structure is VERY small compared to what I had expected. (Just 2.54 MB real data, consuming 4.82 MB of storage sectors)

However, Kodi still creates tons of stuff in the internal 1GB area, to a total size of 78 MB (same as in sessions before kodi_data use).
And this is truly a bug, because this storage is of 'Cache' type, as seen by the Android system.
But this is NOT cache type storage. If it were then clearing it between sessions would be harmless.
Instead the clearing of this cache area will reduce Kodi to uninitialized state, so that the next launch is treated as a 'First Run'.
(Which creates the same 'cache' data again.) So any user of Kodi on Android has to abandon normal system-wide cache clearing.

Until this horrible bug is fixed I have no choice but to uninstall Kodi.

Those 78 MB represent over 30% of the 255 MB free in my 'internal' storage, so that loss is unacceptable.
And it's also unacceptable to never again be permitted to use the global cache clearing command (as it would make Kodi reinitialize).

Whatever data those 78 MB represent, they MUST be stored as something other than system-wide cache.
And for use in devices like my laptop, having small 'internal' area, they MUST be able to use relocatable storage (as set by xbmc_env.properties or other method).

Best regards: dlanor
There is a "hidden" feature in xbmc_env.properties. "xbmc.home" works the same way as "xbmc.data" for the cached data.
It hasn't been tested in a while, though, and might slow down Kodi, but you might want to give it a try...
(2015-05-09, 14:08)Koying Wrote: [ -> ]There is a "hidden" feature in xbmc_env.properties. "xbmc.home" works the same way as "xbmc.data" for the cached data.
It hasn't been tested in a while, though, and might slow down Kodi, but you might want to give it a try...
I will definitely try it, and add my results to this thread a bit later.
Thanks a lot for this information, I really appreciate it (no matter how it works out) ! Smile

Do you by any chance know where I can find some documentation on any other "xbmc_env.properties" features ?

Best regards: dlanor
I have now tested the method suggested by Koying in a recent post, to add an "xbmc.home" definition to the "xbmc_env.properties" file, and after some false starts this has now solved my problem. I can finally use XBMC without having it consume any significant portion of my internal storage area. (Still at 255 MB while running Kodi now, so it has only used a few KB of the internal area.)

About those false starts: (So others can avoid the same mistakes.)
I first tried to add the xbmc.home definition and then restart an existing installation, but that failed miserably (Kodi wouldn't launch at all).
I then tried a brand new installation, first using a special tool to move the installed app away from internal flash and then launching it. This also failed.

What finally worked was to launch a brand new install (or an old one with cleared cache) while the app was still installed in internal flash.
In this run, for the first time, the app created proper content for my "kodi_home" folder in the "/sdcard" area. I then terminated the app again.
After this I used the special tool to move the installed app from internal area to the sdcard area and then relaunched the app successfully.
So the end result is that the app itself is moved to sdcard, and it uses both 'home' and 'data' folders also stored in the "/sdcard" directory.

All's well that ends well. Smile
And great thanks again to Koying for steering me right !

But I still consider it a serious bug that Kodi by default installs and uses storage space the way it does.

Without these special measures (which some end users can't handle) Kodi would have wasted over 200 MB of my internal flash space.
And that could have proven fatal to the ability to install new large apps (even when intended for moving to sdcard).

Best regards: dlanor
Hi is there anyway of xbmc_env.properties or files to use to fix this problem. I've tried but can't get it working, just keeps reading default kodi data.