Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8289] Android: Adding too many views with views to a window

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2012-06-04T19:35:45.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterPete Berry
AssigneeJosh Roesslein
Created2012-03-23T11:20:35.000+0000
Updated2017-03-22T20:36:41.000+0000

Description

The example that follows creates a given number of rows and columns. Each column is a simple view with a label. Each row contains the column views. When run with V8 the errors "Excessive JNI global references (2001)" followed by "VM aborting" are produced. This example works with the Rhino runtime. Even changing the RowCount to 150 works with Rhino, albeit slow ;-) With V8, this example does work if RowCount is set to 30 or less.
var win1 = Ti.UI.createWindow({url:'TheWindow.js'});
win1.open();
var RowCount=35;
var ColCount=25;
var RowHeight=21;
var ColWidth=50;
var TheLabel;
var TheRow;
var TheCol;

for (var Y=1; Y<=RowCount; Y++)
{
  TheRow=Ti.UI.createView({top:((Y-1)*RowHeight), 
                           height:RowHeight});
  for (var X=1; X<=ColCount; X++)
  {
    TheCol=Ti.UI.createView({left:((X-1)*ColWidth), 
                             width:ColWidth,
                             backgroundColor:'white'});
    TheLabel=Ti.UI.createLabel({text:Y + '.' + X});
    TheCol.add(TheLabel);
    TheRow.add(TheCol);
  }
  Ti.UI.currentWindow.add(TheRow);
}

Comments

  1. Josh Roesslein 2012-06-04

    This appears to be caused by the same bug as TIMOB-9322.
  2. Josh Roesslein 2012-06-04

    Closing as a duplicate. Should be resolved when the PR for TIMOB-9322 lands.
  3. Pete Berry 2012-07-05

    Confirmed fixed! Thank you, Pete
  4. Lee Morris 2017-03-22

    Closing ticket as duplicate of the ticket that is mentioned above.

JSON Source