JNI ERROR (app bug): local reference table overflow (max=512)

You must Login before you can answer or comment on any questions.

Does anyone had this error on launching their app on android emulator and/or does anyone know how to fix this?

Thank you.

[ERROR][dalvikvm( 1746)] JNI ERROR (app bug): local reference table overflow (max=512)
[WARN][dalvikvm( 1746)] JNI local reference table (0x2a29b350) dump:
[WARN][dalvikvm( 1746)]   Last 10 entries (of 512):
[WARN][dalvikvm( 1746)]       511: 0x417b3d20 org.appcelerator.kroll.KrollDict
[WARN][dalvikvm( 1746)]       510: 0x4178e4f0 org.appcelerator.titanium.proxy.ActivityProxy
[WARN][dalvikvm( 1746)]       509: 0x417c3960 ti.modules.titanium.ui.TabGroupProxy
[WARN][dalvikvm( 1746)]       508: 0x41ab9f40 org.appcelerator.titanium.proxy.ActionBarProxy
[WARN][dalvikvm( 1746)]       507: 0x417a7820 ti.modules.titanium.ui.TabProxy
[WARN][dalvikvm( 1746)]       506: 0x4178e4f0 org.appcelerator.titanium.proxy.ActivityProxy
[WARN][dalvikvm( 1746)]       505: 0x417c3960 ti.modules.titanium.ui.TabGroupProxy
[WARN][dalvikvm( 1746)]       504: 0x41ab9f40 org.appcelerator.titanium.proxy.ActionBarProxy
[WARN][dalvikvm( 1746)]       503: 0x417a7820 ti.modules.titanium.ui.TabProxy
[WARN][dalvikvm( 1746)]       502: 0x4178e4f0 org.appcelerator.titanium.proxy.ActivityProxy
[WARN][dalvikvm( 1746)]   Summary:
[WARN][dalvikvm( 1746)]         1 of java.lang.String
[WARN][dalvikvm( 1746)]         1 of java.util.HashMap$KeySet
[WARN][dalvikvm( 1746)]       127 of ti.modules.titanium.ui.TabGroupProxy (1 unique instances)
[WARN][dalvikvm( 1746)]         2 of org.appcelerator.kroll.KrollDict (2 unique instances)
[WARN][dalvikvm( 1746)]       127 of org.appcelerator.titanium.proxy.ActivityProxy (1 unique instances)
[WARN][dalvikvm( 1746)]       127 of ti.modules.titanium.ui.TabProxy (1 unique instances)
[WARN][dalvikvm( 1746)]         2 of org.appcelerator.kroll.runtime.v8.V8Object (2 unique instances)
[WARN][dalvikvm( 1746)]       125 of org.appcelerator.titanium.proxy.ActionBarProxy (1 unique instances)
[ERROR][dalvikvm( 1746)] Failed adding to JNI local ref table (has 512 entries)
[INFO][dalvikvm( 1746)] "KrollRuntimeThread" prio=5 tid=12 RUNNABLE
[INFO][dalvikvm( 1746)]   | group="main" sCount=0 dsCount=0 obj=0x417dd180 self=0x2a054000
[INFO][dalvikvm( 1746)]   | sysTid=1768 nice=0 sched=0/0 cgrp=apps handle=704993600
[INFO][dalvikvm( 1746)]   | state=R schedstat=( 3694042358 1815126192 5037 ) utm=337 stm=32 core=0
[INFO][dalvikvm( 1746)]   at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[INFO][dalvikvm( 1746)]   at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64)
[INFO][dalvikvm( 1746)]   at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:861)
[INFO][dalvikvm( 1746)]   at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1084)
[INFO][dalvikvm( 1746)]   at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:316)
[INFO][dalvikvm( 1746)]   at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:100)
[INFO][dalvikvm( 1746)]   at ti.modules.titanium.ui.TabGroupProxy.handleMessage(TabGroupProxy.java:103)
[INFO][dalvikvm( 1746)]   at android.os.Handler.dispatchMessage(Handler.java:95)
[INFO][dalvikvm( 1746)]   at android.os.Looper.loop(Looper.java:137)
[INFO][dalvikvm( 1746)]   at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[INFO][dalvikvm( 1746)] 
[ERROR][dalvikvm( 1746)] VM aborting
F/libc    ( 1746): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 1768 (KrollRuntimeThr)

Application type: mobile Titanium SDK version: 3.1.1 (06/15/13 16:09 f7592c1) Platform & version: Android 4.3 and 2.3.3 Device: Android emulator Host Operating System: OSX 10.8.4 Mountain Lion Titanium Studio: build: 3.1.1.201306112235

— asked 11 months ago by Mihai Marginean
1 Comment
  • Hello Mihai,

    I'm sure you'll agree, that your question doesn't give us much to work with. I strongly suggest you have a look at the guidelines to follow when asking a question.

    Also, please include some code detailing what you are trying to achieve. This will give everyone a better understanding of the problem you are facing.

    — commented 11 months ago by Christian Brousseau

1 Answer

Hello,

I solved this problem. In my case the problem was generated by improper cleaning of tableView data. I had 19 TI.UI.TableViewRow created with a code like this:

function createData(){
 
var data = [];
 
    var row = Ti.UI.createTableViewRow({
        selectedBackgroundColor : '#5E5959',
        height : '60dp',
        className : 'datarow',
        clickName : 'Park - Group',
        selectedColor : '#fff',
        backgroundColor : bgcolor,
 
    });
 
    var photo = Ti.UI.createView({
        backgroundImage : 'icons/park.png',
        top:'9dp',
        left: '10dp',
        width: '40dp',
        height: '40dp',
        clickName:'photo'
    });
    row.add(photo);
    var user = Ti.UI.createLabel({
        color:'#E7E7E7',
        font: {
            fontSize: '20dp',
            fontWeight:'bold',
            fontFamily:'Arial'
        },
        left: '85dp',
        top: '9dp',
        height: '40dp',
        right: '10dp',
        text:'Park - Group'
    });
    row.add(user);
    data.push(row);
 
    //repeat that 19 times for different rows
    return data;
}
than i had a tableView created like this:
var tableView = Titanium.UI.createTableView({
        data:createData(),
        backgroundColor:'#000',
        allowsSelection:true,
        scrollable:true
    });
and I tried to clean tableView data like this:
tableView.setData([]);
win.remove(tableView);
win.close();
then I changed the cleaning of the tableView to look like this:
win.remove(tableView);
win.close();
for (var i = tableView.data[0].rows.length-1; i >= 0; i--) {
       tableView.deleteRow(i);
}
tableView.setData([]);
Problem solved.

PS. The error I received at first looked like the one in my first post but in the logs there was also something like this:

[ERROR][dalvikvm(18879)] JNI ERROR (app bug): local reference table overflow (max=512)
[WARN][dalvikvm(18879)] JNI local reference table (0x2a262df8) dump:
[WARN][dalvikvm(18879)]   Last 10 entries (of 512):
[WARN][dalvikvm(18879)]       511: 0x41e68748 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       510: 0x41e652e8 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       509: 0x41e61ef0 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       508: 0x41e5eb00 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       507: 0x41e5b708 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       506: 0x41e58318 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       505: 0x41e54f10 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       504: 0x41e51b08 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       503: 0x41e4e6d0 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]       502: 0x41e4b2d0 ti.modules.titanium.ui.TableViewRowProxy
[WARN][dalvikvm(18879)]   Summary:
[WARN][dalvikvm(18879)]         1 of java.lang.Object[]
[WARN][dalvikvm(18879)]         1 of ti.modules.titanium.ui.TableViewRowProxy[] (19 elements)
[WARN][dalvikvm(18879)]         8 of ti.modules.titanium.ui.LabelProxy (8 unique instances)
[WARN][dalvikvm(18879)]         1 of org.appcelerator.kroll.runtime.v8.V8Function
[WARN][dalvikvm(18879)]       493 of ti.modules.titanium.ui.TableViewRowProxy (19 unique instances)
[WARN][dalvikvm(18879)]         8 of ti.modules.titanium.ui.ViewProxy (8 unique instances)
[ERROR][dalvikvm(18879)] Failed adding to JNI local ref table (has 512 entries)

Your Answer

Think you can help? Login to answer this question!