Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11358] Android: Many calls to getFIle causes local reference table overflow

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-14T22:37:13.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 2.1.4, Release 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21
ComponentsAndroid
Labelsapi, module_filesystem, qe-manualtest, qe-port, triage
ReporterNikhil Sharma
AssigneeHieu Pham
Created2012-10-10T19:10:31.000+0000
Updated2014-08-14T22:37:13.000+0000

Description

Many calls to getFile with the application data directory causes the local reference table overflow error. It works fine on android 2.3.4 and 3.1, but on android 4.0.1 and 4.1 it stops after the 504 calls.

Repo Steps

1. Run the below code in your app.js 2. Open the DDMS and you can see that it stops at 504 call and gives the above error.
var win = Ti.UI.createWindow({
	backgroundColor : "red"
})
for (var i = 0; i < 512; i++) {

	Ti.API.info(i);
	var dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, "test");

};
win.open();

Attachments

FileDateSize
crash_log.rtf2012-10-10T22:01:43.000+000012675

Comments

  1. Josh Roesslein 2012-10-13

    Created [PR #3221](https://github.com/appcelerator/titanium_mobile/pull/3221) to resolve issue in master.
  2. Ingo Muschenetz 2012-10-14

    Need to backport to 2_1_X branch.
  3. Josh Roesslein 2012-10-14

    Created [PR #3230](https://github.com/appcelerator/titanium_mobile/pull/3230) to back port fix into 3.0 release.
  4. Ingo Muschenetz 2012-10-18

    I don't believe we have a 2.1.X backport PR yet. Could you please generate that?
  5. Hieu Pham 2012-10-24

    2.1.X PR: https://github.com/appcelerator/titanium_mobile/pull/3316
  6. Natalie Huynh 2012-11-01

    Tested with 2.1.4.v20121030173408 on Droid 3 2.3.4

JSON Source