Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Clearing Picker Causes Local Reference Table Overflow

$
0
0

3.3.0 GA

Android 4.1.2

I have a window with 3 pickers at the bottom - The first picker usually has about 15 entries, so that picker will delete and refresh it's data just fine. The second picker can have anywhere from 100 to 170 entries in it. This picker ALWAYS causes a Local Reference Table Overflow when I try and delete the rows (it will get about 3 to 4 removeRow calls in and crash). Is there an easy way to delete a large amount of data out of a picker like this?

The work around I am using now is to create all the pickers I need for the first two pickers ahead of time and just hiding/showing them depending on what the third pickers value is set at... This seems a bit redundant and it actually won't work with V2 of our app because there will now be more than 2 choices for the sets of data (and each object will be different, some could have 2, some could have 5 - All with picker 1 having ~15 values and all with picker 2 having 100+ values).

Here's how I load up my picker:

for (var x = 0; x <= linetemp.length-1; x++)
    {
            var length = 0;
            length = linetemp[x];
            linedepth.push(Ti.UI.createPickerRow({title:x+1,len:length}));      
    }
 
   depthpicker.add(linedepth);
linetemp gets it data from a txt file. It's just a series of comma separated values paired with lengths and depths. (picker 1 = depth and picker 2 = length). I only show the depth picker here, but the population isn't the issue, it's the next part (deleting).

Here's my code for deleting:

function removeData(){
 
       if(depthpicker.columns[0]) {
            var _col = depthpicker.columns[0];
                var len = _col.rowCount;
                for(var x = len-1; x >= 0; x--){
                        var _row = _col.rows[x];
                        _col.removeRow(_row);
                }
        } 
 
}
console output:
[ERROR] :  dalvikvm: JNI ERROR (app bug): local reference table overflow (max=512)
[WARN] :   dalvikvm: JNI local reference table (0x2a214950) dump:
[WARN] :   dalvikvm:   Last 10 entries (of 512):
[WARN] :   dalvikvm:       511: 0x416a68e0 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       510: 0x416a5e68 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       509: 0x416a53f0 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       508: 0x416a4978 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       507: 0x416a3f00 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       506: 0x416a3468 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       505: 0x416a29f0 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       504: 0x416a1f90 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       503: 0x416a1530 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:       502: 0x416a0b18 ti.modules.titanium.ui.PickerRowProxy
[WARN] :   dalvikvm:   Summary:
[WARN] :   dalvikvm:         1 of java.lang.String
[WARN] :   dalvikvm:         7 of ti.modules.titanium.ui.PickerColumnProxy (2 unique instances)
[WARN] :   dalvikvm:         1 of org.appcelerator.kroll.runtime.v8.V8Object
[WARN] :   dalvikvm:         1 of org.appcelerator.kroll.KrollDict
[WARN] :   dalvikvm:         1 of ti.modules.titanium.ui.PickerRowProxy[] (143 elements)
[WARN] :   dalvikvm:       501 of ti.modules.titanium.ui.PickerRowProxy (160 unique instances)
[ERROR] :  dalvikvm: Failed adding to JNI local ref table (has 512 entries)
I will add that this does NOT crash on my Note 3, only in the emulator, but I suspect this will crash on older devices and I don't have any to test with (Only my Note and HTC ONE). The funny thing is, I can add triple the data to the middle picker. I accidentally didn't remove the data and added in another two sets of 170 numbers and it didn't crash... It's only when I try and delete rows that it crashes.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>