0

Experiencing 'out of memory' error during normal usage.

Our widget is locking up after about 1 minute of opening and closing views (sidebar views). After the widget locks up, we simply cannot select any new views. This is an error we are trying to get resolved before submission.
WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WE 00:02:36:023: [T:6008] ERROR!ERROR!ERROR!ERROR!ERROR!WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WE 00:02:36:023: [T:6008] WIDGET NAME [www.widgets.mine]  // changed name of widgetWE 00:02:36:024: [T:6008] out of memory (init.js: Line 342) // not always this line number, also this line number only assigns a string to a var
We have tried several approaches to resolve our issue. Our views are loaded dynamically only being created when selected (from JSON data). We have used /mem in the log before and after the error. Our memory is a little higher after the error, but it is not substantially different. I can post this log if needed. When a view is no longer in use, we have removed that view from the widget and removed the view from the DOM. Our DOM is consistent in size throughout usage. We have also manually set the views 'cache' and 'controls' to an empty object and set 'rendered' to false before removing the view. We resorted to this method as we could still access the properties of the "unloaded" view after KONtx.application.unloadView was called. It isn't any one view that is causing this behavior. We are using KONtx framework v1.3.

We can use the widget longer in the simulator but we still experience the same behavior. I have read that this may be due to the resources available in the simulator. We have tested this widget on Vizio, Toshiba, and Sony TV's.

Any help and/or suggestions would be greatly appreciated.

by
3 Replies
  • That error didn't come through very well:

    WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 00:02:36:023: [T:6008] ERROR!ERROR!ERROR!ERROR!ERROR!
    WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 00:02:36:023: [T:6008] WIDGET NAME [www.widgets.tv.www]    // changed name of widget
    WE 00:02:36:024: [T:6008] out of memory (init.js: Line 342)    // not always this line number, also this line number only assigns a string to a var
    0
  • Every widget is limited to 2MB RAM so if your widget exceeds that, it will get the "Out of memory" problem. Some suggestions to solve this issue follow. Ensure that there are no unnecesary global variables holding up references to view controls This will prevent the views from getting garbage collected. Try and step through the widget while issuing mem command on the console to find out which view causes a jump in memory(which stays that way and doesn't come down), and try to find the causes. Keep the DOM elements minimal per view, so if there is a complex view with too many elements, break it up into multiple simpler views. Let me know how it goes.

    Thanks,
    Vivek

    QUOTE(Josh @ 23 Aug 2012 4:48 PM)
    That error didn't come through very well:

    WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 00:02:36:023: [T:6008] ERROR!ERROR!ERROR!ERROR!ERROR!
    WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 00:02:36:023: [T:6008] WIDGET NAME [www.widgets.tv.www]    // changed name of widget
    WE 00:02:36:024: [T:6008] out of memory (init.js: Line 342)    // not always this line number, also this line number only assigns a string to a var
    0
  • Thank you so much for the quick response. I'm getting some weird behavior - in the emulator, when I get the out of memory error, the memory usage shows 2MB like you said, but when I step through and am looking at the memory usage, I notice that sometimes prior to that, it can get way above that such as up to 3MB with no out of memory error.  Do you know what would explain this?
     

    QUOTE(Vivek Jani @ 24 Aug 2012 3:20 AM)
    Every widget is limited to 2MB RAM so if your widget exceeds that, it will get the "Out of memory" problem. Some suggestions to solve this issue follow. Ensure that there are no unnecesary global variables holding up references to view controls This will prevent the views from getting garbage collected. Try and step through the widget while issuing mem command on the console to find out which view causes a jump in memory(which stays that way and doesn't come down), and try to find the causes. Keep the DOM elements minimal per view, so if there is a complex view with too many elements, break it up into multiple simpler views. Let me know how it goes.

    Thanks,
    Vivek

    QUOTE(Josh @ 23 Aug 2012 4:48 PM)
    That error didn't come through very well:

    WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 00:02:36:023: [T:6008] ERROR!ERROR!ERROR!ERROR!ERROR!
    WE 00:02:36:023: [T:6008] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 00:02:36:023: [T:6008] WIDGET NAME [www.widgets.tv.www]    // changed name of widget
    WE 00:02:36:024: [T:6008] out of memory (init.js: Line 342)    // not always this line number, also this line number only assigns a string to a var
    0

Recent Posts

in General - Yahoo! TV Widgets