Closed Bug 1237568 Opened 8 years ago Closed 8 years ago
[TV] Browser app can be killed by OOM with big history or bookmarks stores
We are currently saving in memory the whole list of history and bookmark records . This can cause the browser app to be killed if any of these lists or records are big enough.  https://mxr.mozilla.org/gaia/source/tv_apps/browser/js/bookmarkStore.js#23  https://mxr.mozilla.org/gaia/source/tv_apps/browser/js/historyStore.js#14
Severity: normal → blocker
This issue won't let us land bug 1232276 for the TV to sync the whole list of bookmarks or history :( Check bug 1237570
Target Milestone: --- → 2.6 S5 - 1/15
Target Milestone: 2.6 S5 - 1/15 → 2.6 S6 - 1/29
Thank you for figuring it out! Dan could you please work on this?
Got it! I am working on this.
Assignee: nobody → dhuang
Hi Fernando, I had used webIDE to snapshot browser's memory usage between open sync history list and close the list. It seems the memory usage didn't increase continuously after closing the list. So could you tell us how do you get the OOM in browser? Thanks.
Hello Dan, I didn't get any OOM because I can't test this on the real TV. On B2G Desktop we are running with a single process and we have no OOM killer. So unfortunately it's currently not possible to test this. However, looking at the code, it gave me the impression that the OOM situation is possible. With the current setting you probably won't see a significant peak of memory given that we limit the number of records that we fetch from the server. But with no control over this, like we were adding on bug 1232276, we may end up fetching a significantly big number of records. For example, I have around 15K history records on my account. If I understood the code properly, we may end up loading in memory the whole list of history if the user scrolls down through the history list. Is this correct? If my assumption above is not correct, then we can safely close this bug :)
Hello all, While we are discussing the memory consumption issue, there are some requirements for the memory profiling tool in my mind: 1. Peak value during a specific time. 2. Overall report to summarize the memory usage for Gaia. 3. Object allocation statistics corresponded to a script/app. We got a feedback from Performance team that we can use Memory Profiler  add-on to investigate the memory consumption for a specific time slot. There are some steps to install the add-on: a. Download Mulet by 'make mulet' or other way. b. In about:config, type and search this configure "xpinstall.signatures.required" and set it to false (double click "value" field to change value) c. Download  and drag the add-on file to Mulet, and then install it. Now you can see there is 'Memory Profiler' tab in developer tools. Click start/stop to record the memory usage.  https://wiki.mozilla.org/MemoryProfiler  https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Memory_Profiler  https://www.dropbox.com/s/3ynu5f6hk7uy91y/memory-profiler-ui-0.1.xpi?dl=0
In attachment 8706747 [details], self peak and total peak can tell the information about peak memory consumption. Kan-ru is the project owner. I will discuss detail with him (he's in business trip now).
That's great news Dan. Thanks for checking it!
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.