1

I have a large array of strings (about 800 items) in the resource file arrays.xml And when a trying read it:

String[] arr = context.getResources().getStringArray(R.array.text);

I get error:

ReferenceTable overflow (max=512)
Last 10 entries in JNI local reference table:
502: 0x44ea8b28 cls=Ljava/lang/String; (28 bytes)
503: 0x44ea8c98 cls=Ljava/lang/String; (28 bytes)
504: 0x44ea8df0 cls=Ljava/lang/String; (28 bytes)
505: 0x44ea8f20 cls=Ljava/lang/String; (28 bytes)
506: 0x44ea8f98 cls=Ljava/lang/String; (28 bytes)
507: 0x44ea9070 cls=Ljava/lang/String; (28 bytes)
508: 0x44ea91a0 cls=Ljava/lang/String; (28 bytes)
509: 0x44ea9328 cls=Ljava/lang/String; (28 bytes)
510: 0x44ea94c8 cls=Ljava/lang/String; (28 bytes)
511: 0x44ea9618 cls=Ljava/lang/String; (28 bytes)
JNI local reference table summary (512 entries):
3 of Ljava/lang/Class; 172B (2 unique)
506 of Ljava/lang/String; 28B (506 unique)
1 of Ljava/lang/String; 36B
1 of [Ljava/lang/String; 28B
1 of [Ljava/lang/String; 3212B
Memory held directly by native code is 17788 bytes
Failed adding to JNI local ref table (has 512 entries)

How do I solve this problem?

Odrin
  • 90
  • 6
  • It says "overflow (max=512)". I suggest trying to take strings one by one and see if it throws this error at 512nd item. Have to say I don't have good knowledge about the topic, just a guess. It looks like so in the error, so open two arrays or a dynamic list. – İsmet Alkan May 05 '12 at 08:51
  • This link should help you. http://stackoverflow.com/questions/4174453/android-native-process-provoke-referencetable-overflow-after-a-while-android-n – Saqlain Jun 07 '12 at 11:19

0 Answers0