mbcache.db files is almost 4GB!

blacknwhite77

Member
Dec 1, 2016
12
1
0
I have Kodi installed and been having problem with "low storage" and continuous hangs on the system. It is rooted.
I was checking file sizes and noticed that this one is suspiciously quiet large:
/data/data/com.amazon.tv.launcher/databases/mbcache.db

[email protected]:/data/data/com.amazon.tv.launcher/databases # ls -l
-rw-rw---- amz_a46 amz_a46 20480 2016-12-18 16:29 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-18 16:29 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 3998175232 2016-12-18 16:32 mbcache.db
-rw------- amz_a46 amz_a46 65536 2016-12-18 16:32 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-18 16:32 mbcache.db-wal

On a system that has total 5GB this seems troubling.

Not sure where is the problem. How to fix this?
 

blurp76

Senior Member
May 29, 2009
63
5
0
I have the same exact problem! Rooted aftv1, this has happened first time few weeks ago, it took some time to find this file and delete it. two days ago I found it already grown again to 4gb.
Tried to change file permission but it's still growing.
Any help from the experts would be really appreciated.
 
  • Like
Reactions: blacknwhite77

blacknwhite77

Member
Dec 1, 2016
12
1
0
I have the same exact problem! Rooted aftv1, this has happened first time few weeks ago, it took some time to find this file and delete it. two days ago I found it already grown again to 4gb.
Tried to change file permission but it's still growing.
Any help from the experts would be really appreciated.
Thanks for your reply.
Yes, I deleted it, back it is growing back. What is weird is this only been happening recently, and I have not done any changes to my FireTV 1. i am wondering if Amazon launcher has changed and expected all users to have updated their firmwares to something more recent that what I have.
I hope someone would be able to help us figure this out.
 

KLit75

Senior Member
Jun 29, 2014
2,049
313
0
I have Kodi installed and been having problem with "low storage" and continuous hangs on the system. It is rooted.
I was checking file sizes and noticed that this one is suspiciously quiet large:
/data/data/com.amazon.tv.launcher/databases/mbcache.db

[email protected]:/data/data/com.amazon.tv.launcher/databases # ls -l
-rw-rw---- amz_a46 amz_a46 20480 2016-12-18 16:29 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-18 16:29 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 3998175232 2016-12-18 16:32 mbcache.db
-rw------- amz_a46 amz_a46 65536 2016-12-18 16:32 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-18 16:32 mbcache.db-wal

On a system that has total 5GB this seems troubling.

Not sure where is the problem. How to fix this?
Did you figure this out? I wonder if it's Photos coming from amazon...4GB seems extreme but if it were left unattended maybe. First try going into settings>manage apps>photos and clear cache then check the to see if mbcache reduced in size. If so then there's your issue. Set your screensaver to something else or maybe turn it off. Let me know how you make out. I might be able to help
 

blacknwhite77

Member
Dec 1, 2016
12
1
0
Did you figure this out? I wonder if it's Photos coming from amazon...4GB seems extreme but if it were left unattended maybe. First try going into settings>manage apps>photos and clear cache then check the to see if mbcache reduced in size. If so then there's your issue. Set your screensaver to something else or maybe turn it off. Let me know how you make out. I might be able to help
Hi Klite75,
I checked photos app and there is not much data there, around 5M, I cleared the cache but nothing affected the mbcache. I also checked the screensaver and found that I have it off, and "never" run.
What is weird is that the FireTV has been off since yesterday, but when I checked the mbcache.db file through adb from my PC I found that it was accessed some 30 minutes ago?!!! Who is accessing this file while the FireTV off?

[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 64180224 2016-12-20 18:17 mbcache.db
-rw------- amz_a46 amz_a46 32768 2016-12-20 18:17 mbcache.db-shm
-rw------- amz_a46 amz_a46 11317672 2016-12-20 18:17 mbcache.db-wal
 

KLit75

Senior Member
Jun 29, 2014
2,049
313
0
Hi Klite75,
I checked photos app and there is not much data there, around 5M, I cleared the cache but nothing affected the mbcache. I also checked the screensaver and found that I have it off, and "never" run.
What is weird is that the FireTV has been off since yesterday, but when I checked the mbcache.db file through adb from my PC I found that it was accessed some 30 minutes ago?!!! Who is accessing this file while the FireTV off?

[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 64180224 2016-12-20 18:17 mbcache.db
-rw------- amz_a46 amz_a46 32768 2016-12-20 18:17 mbcache.db-shm
-rw------- amz_a46 amz_a46 11317672 2016-12-20 18:17 mbcache.db-wal
Fire tv doesn't really turn off.
I checked mine (aftv1 rooted running OS5) & mbcache is filling up--about 32 MB.
If I had to wager a guess Id say theres an app thats downloading lots of data.
I did a little search but came up with nada
If I had time to wait around I might sit tight, maybe someone has a solution...
Otherwise do a factory reset and see if it happens again.
 

blacknwhite77

Member
Dec 1, 2016
12
1
0
Fire tv doesn't really turn off.
I checked mine (aftv1 rooted running OS5) & mbcache is filling up--about 32 MB.
If I had to wager a guess Id say theres an app thats downloading lots of data.
I did a little search but came up with nada
If I had time to wait around I might sit tight, maybe someone has a solution...
Otherwise do a factory reset and see if it happens again.
Would it be possible for me to track the network connections the FireTV has, and which ones are being active? Maybe that would give me a clue which app is doing that. But I have no idea how to do such network monitoring.
 

KLit75

Senior Member
Jun 29, 2014
2,049
313
0
Would it be possible for me to track the network connections the FireTV has, and which ones are being active? Maybe that would give me a clue which app is doing that. But I have no idea how to do such network monitoring.
Anything's possible, unfortunately off the top of my head I dont have a method. Long shot youd have one but years ago I'm pretty sure I could keep tabs on that when I had DDWRT installed on my router.
***speaking of my fuzzy memory (read lots of stuff here) and Im about 80% certain someone posted here that was able to track specific network activity, though he didn't share his method. Don't think anyone asked.
Sorry. I've come to the conclusion that if I spend too much time struggling with android, the easiest thing to do is nuke it--factory reset. You can make a backup 1st so if the issue reappears you just go back and your data will be there.
 

blacknwhite77

Member
Dec 1, 2016
12
1
0
Between last night and this morning, I did not switch on the FireTV and to my knowledge all applications are (forced quit).
But I see the the mbcache.db file has increased from 64M to 88M. There is definitely something going on that is not right.
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 64180224 2016-12-20 18:17 mbcache.db
-rw------- amz_a46 amz_a46 32768 2016-12-20 18:17 mbcache.db-shm
-rw------- amz_a46 amz_a46 11317672 2016-12-20 18:17 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 88875008 2016-12-21 07:43 mbcache.db
-rw------- amz_a46 amz_a46 65536 2016-12-21 07:43 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-21 07:43 mbcache.db-wal

I have spare ddwrt router that I can program as a switch and have it sit in between the FireTV and the 1st router. But I don't know how to monitor all traffic going through this 2bd ddwrt router. Any help is appreciated.
 

blacknwhite77

Member
Dec 1, 2016
12
1
0
I did chmod on the file to 0.
So far it has not accumulated any more data, hopefully that solves the issue.

Code:
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46  amz_a46     20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46  amz_a46     12824 2016-12-21 19:34 cmsapi.db-journal
---------- root     root            0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46  amz_a46    294912 2016-12-22 21:07 mbcache.db-shm
-rw------- amz_a46  amz_a46  17271072 2016-12-22 21:07 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll                  
-rw-rw---- amz_a46  amz_a46     20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46  amz_a46     12824 2016-12-21 19:34 cmsapi.db-journal
---------- root     root            0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46  amz_a46    294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46  amz_a46    828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll                  
-rw-rw---- amz_a46  amz_a46     20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46  amz_a46     12824 2016-12-21 19:34 cmsapi.db-journal
---------- root     root            0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46  amz_a46    294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46  amz_a46    828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll                  
-rw-rw---- amz_a46  amz_a46     20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46  amz_a46     12824 2016-12-21 19:34 cmsapi.db-journal
---------- root     root            0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46  amz_a46    294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46  amz_a46    828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll                  
-rw-rw---- amz_a46  amz_a46     20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46  amz_a46     12824 2016-12-21 19:34 cmsapi.db-journal
---------- root     root            0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46  amz_a46    294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46  amz_a46    828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll                  
-rw-rw---- amz_a46  amz_a46     20480 2016-12-23 12:38 cmsapi.db
-rw-rw---- amz_a46  amz_a46     12824 2016-12-23 12:38 cmsapi.db-journal
---------- root     root            0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46  amz_a46    294912 2016-12-23 12:39 mbcache.db-shm
-rw------- amz_a46  amz_a46    524288 2016-12-23 12:39 mbcache.db-wal
 
  • Like
Reactions: blurp76

entropyaz

New member
Jun 21, 2010
2
1
0
I did chmod on the file to 0.
So far it has not accumulated any more data, hopefully that solves the issue.

I too started running into the out of storage space problem a few weeks ago and arrived at the large mbcache.db and mbcache.db-wal files. I SCP'd them off of the firetv to look at offline, and they are SQLite database files that seem to cache all of the app/media metadata information that is pulled down from amazon (name/description/links to images and background images/etc).

Some sample snippets from the database:

Code:
$strings -a mbcache.db | head -n1
SQLite format 3

$strings -a mbcache.db | egrep ^text | head -n10
textOFields of Battle
textMBest of Movies
textPRecently Added TV
textJTrending TV
textZOriginal & Exclusive Movies
textSRecommended Drama TV
textaRecommended Science Fiction Movies
textNElection Movies
textWTop Movies & TV on Prime
textWAmazon Original Comedies
Note: XDA wouldn't let me post links, but I wanted to demonstrate above that the database also calls images/background images via http for items in the launcher.


I don't think removing the permissions that make these files writable is necessarily the correct fix though, or at least if you still plan on using the stock Amazon launcher, which many of us do. When this file is not writable (chmod 0), several of the menu items (home/prime/tv/movies/etc) will not populate with anything and get stuck on a loading screen and remain empty. The device needs to be able to pull down metadata and write to the mbcache files for items to populate in these menus.

After I removed the files and rebooted the firetv, the new mbcache file created was about 5mb. I'll need to do some monitoring to see how often this file is written to and how quickly it grows, but I suspect what is happening is this file is append only and continues to grow as new items are added to the amazon library online and are cached locally on the firetv. If that is the case, it makes me wonder if it was an oversight in the firmware coding to not set a max file size and clean/purge old cached items. If it's a slow increase of ~5mb per day or so, that might explain why it took so long to finally exhaust all available free space on the firetv and only recently started becoming an apparently issue for us.

I'm currently running 51.1.6.3. I'm going to monitor/test for a few days on this firmware, and then I'm going to flash the latest pre-rooted stock 5.2.1.1 and see if there's any difference. If there is nothing in the firmware to limit the size that this file can grow to or purge old cached items out, then it might need to be a file that needs to be manually removed by users at some regular interval (1-12 months) or something.

For anyone not using the amazon launcher (firedtvlauncher or similar), then the chmod 0 solution will probably be fine. My comments are really more aimed at retaining stock amazon launcher functionality while addressing the file size issue.

This is just after some preliminary troubleshooting and will need to do some further monitoring/testing, but hope this info helps for anyone else running into the problem.
 
  • Like
Reactions: frozndevl

blacknwhite77

Member
Dec 1, 2016
12
1
0
I too started running into the out of storage space problem a few weeks ago and arrived at the large mbcache.db and mbcache.db-wal files. I SCP'd them off of the firetv to look at offline, and they are SQLite database files that seem to cache all of the app/media metadata information that is pulled down from amazon (name/description/links to images and background images/etc).

Some sample snippets from the database:

Code:
$strings -a mbcache.db | head -n1
SQLite format 3

$strings -a mbcache.db | egrep ^text | head -n10
textOFields of Battle
textMBest of Movies
textPRecently Added TV
textJTrending TV
textZOriginal & Exclusive Movies
textSRecommended Drama TV
textaRecommended Science Fiction Movies
textNElection Movies
textWTop Movies & TV on Prime
textWAmazon Original Comedies
Note: XDA wouldn't let me post links, but I wanted to demonstrate above that the database also calls images/background images via http for items in the launcher.


I don't think removing the permissions that make these files writable is necessarily the correct fix though, or at least if you still plan on using the stock Amazon launcher, which many of us do. When this file is not writable (chmod 0), several of the menu items (home/prime/tv/movies/etc) will not populate with anything and get stuck on a loading screen and remain empty. The device needs to be able to pull down metadata and write to the mbcache files for items to populate in these menus.

After I removed the files and rebooted the firetv, the new mbcache file created was about 5mb. I'll need to do some monitoring to see how often this file is written to and how quickly it grows, but I suspect what is happening is this file is append only and continues to grow as new items are added to the amazon library online and are cached locally on the firetv. If that is the case, it makes me wonder if it was an oversight in the firmware coding to not set a max file size and clean/purge old cached items. If it's a slow increase of ~5mb per day or so, that might explain why it took so long to finally exhaust all available free space on the firetv and only recently started becoming an apparently issue for us.

I'm currently running 51.1.6.3. I'm going to monitor/test for a few days on this firmware, and then I'm going to flash the latest pre-rooted stock 5.2.1.1 and see if there's any difference. If there is nothing in the firmware to limit the size that this file can grow to or purge old cached items out, then it might need to be a file that needs to be manually removed by users at some regular interval (1-12 months) or something.

For anyone not using the amazon launcher (firedtvlauncher or similar), then the chmod 0 solution will probably be fine. My comments are really more aimed at retaining stock amazon launcher functionality while addressing the file size issue.

This is just after some preliminary troubleshooting and will need to do some further monitoring/testing, but hope this info helps for anyone else running into the problem.
Thank you very much!
Yes, I suspected the file has to do with Amazon launcher caching media, but did not have the proper skills to investigate the file, you did an excellent job there.
I have been thinking about flashing to a newer firmware but I dont want to lose root. It is a first gen firetv so it might also start to slow down with new firmware.
You are correct about the "no movies loaded" at the start screen after I chmod permissions, but so far this was the only thing that worked. I already tried to remove the file but it starts piling up really quickly, I am sure Amazon started allowing higher resolution media which eats memory quicker (maybe a way to slow down devices and forces people buying the next gen).
Anyways, keep us informed on what you find and come up with as a solution.
 

Y314K

Senior Member
Dec 29, 2008
1,489
487
0
My best guess is that it has to do with FW 5.2.4.0 & all the changes it brings. Specially on the server side of things. This just started to happen as this changes took place.

http://www.aftvnews.com/fire-tv-update-5-2-4-0-was-halted-due-to-appstore-server-load-concerns/

As for the mbcache.db & related files being reconstructed very quickly even after being deleted I think it's related to this new FW 5.2.4.0 GUI "feature" (auto-playing video and audio on home screen interface) which we on older FW have no way of controlling. And there for this cache repopulate themselves in days. When we have never been affected by this for years of our devices usage.

http://www.aftvnews.com/how-to-disa...dio-on-the-new-fire-tv-home-screen-interface/

This is all my assumption, but I think it's no coincidence that for the most part FireOS 3 devices on really old FW are the worst affected. Newer FW handles this cache's better since Amazon knew their cache needs where increasing with each update & new features & GUI changes.

One of my FTV1's is @ the latest PreRooted Rom. That MBCache.db is @ 18.6 MiB after a week of usage. This is why I think age of FW has to do with outdated handling of the MBCache.db & other cache files in my opinion.

Bottom line, the older FW you have on your FTV1 the more likely to have this "out of space" due to MBCache.db problems.
 
Last edited:

Modify_inc

Senior Member
Dec 27, 2013
78
7
28
I dealt with this issue back in early December or so. I deleted the mbcache.db and freed up GBs of space. Of course it has grown to GBs of space again, so I just deleted it again. Well not sure what was different from last time to this time, but I noticed my TV went blank; I couldn't get the AFTV to display anything. Pressed all the buttons, turned my TV on and off, cycled inputs, just figured it was a glitch. So, I finally tried the force reset, by holding the Home and Play buttons. To my surprise it actually rebooted, so I felt better. It showed the Amazon splash screen and my Boot recovery options, but when it got fully loaded, the TV screen was blank again. I tried to run kodi using my press Home button twice shortcut, but it didn't work.

I keep checking the database to see if it is growing, but it seems to be stuck at 5536. I'm curious, is it safe to delete the other file databases in the databases folder? I'm curious if one of them became corrupted or got out of sync with the mbcache.db when I deleted it.
 

blacknwhite77

Member
Dec 1, 2016
12
1
0
I dealt with this issue back in early December or so. I deleted the mbcache.db and freed up GBs of space. Of course it has grown to GBs of space again, so I just deleted it again. Well not sure what was different from last time to this time, but I noticed my TV went blank; I couldn't get the AFTV to display anything. Pressed all the buttons, turned my TV on and off, cycled inputs, just figured it was a glitch. So, I finally tried the force reset, by holding the Home and Play buttons. To my surprise it actually rebooted, so I felt better. It showed the Amazon splash screen and my Boot recovery options, but when it got fully loaded, the TV screen was blank again. I tried to run kodi using my press Home button twice shortcut, but it didn't work.

I keep checking the database to see if it is growing, but it seems to be stuck at 5536. I'm curious, is it safe to delete the other file databases in the databases folder? I'm curious if one of them became corrupted or got out of sync with the mbcache.db when I deleted it.
Same here. What I thought was the solution (changing permissions on the file) actually messed up my FireTV. I can't even power the FireTV on from my remote, I have to pull the plug and replug, and even then I get to the loading movies/...etc screen with spinning wheel for ever, remote doesn't do anything.

I am wondering if it is time to load a ROM or something that has the newest firmware bits but keep root.
Or maybe simply move on and buy a FireTV 2.
 

xm41907

Senior Member
Dec 7, 2010
345
74
0
I too have been having this low memory issue. I'm on quite an old firmware and also having an issue with the FireTv randomly rebooting to recovery (CWM). I don't even have much installed on my system. I have a simple Kodi (No library content on it), Netflix, YouTube, and Total Commander and I still consistently run out of space. At most, I've only been able to keep about .5 gig free. When I get home tonight I will check the size of these files and see how much it frees up. I think it is time to take the plunge and install TWRP then the latest pre-root. I don't think I can keep firestarter running after that though. :/