I use the intermediary of a serial file in the 'raw' folder - read it
in java or c.
I read this file line by line. Its kinda using a file instead of RAM
to store loads of strings.
Works for large files AFAIK and reads are fast. Also
I do not have the problem of garbage collection or emergency
memory clear outs that can happen (sh-t happens)

Probably not right for you but at least I tried.....




On Dec 14, 7:54 am, Peter Staab <pixst...@gmx.net> wrote:
> Hi,
>
> I need to pass a list of many strings (can be up to 10000) to JNI. The
> strings are stored in a String[] array but if other data structures
> are more appropriate then these would be a valid option too.
> The passing of the string array works fine, but only for low number of
> strings. For bigger array sizes I get the following error:
> ++++++
> 12-14 08:52:51.636: W/dalvikvm(2999): ReferenceTable overflow
> (max=512)
> 12-14 08:52:51.636: W/dalvikvm(2999): Last 10 entries in JNI local
> reference table:
> 12-14 08:52:51.636: W/dalvikvm(2999):   502: 0x4000e878 cls=Ljava/lang/
> Class; 'Ljava/lang/String;' (284 bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   503: 0x4053e290 cls=[B (36
> bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   504: 0x405227f0 cls=Ljava/lang/
> String; (28 bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   505: 0x4000e878 cls=Ljava/lang/
> Class; 'Ljava/lang/String;' (284 bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   506: 0x4053e2b8 cls=[B (36
> bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   507: 0x40522870 cls=Ljava/lang/
> String; (28 bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   508: 0x4000e878 cls=Ljava/lang/
> Class; 'Ljava/lang/String;' (284 bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   509: 0x4053e2e0 cls=[B (36
> bytes)
> 12-14 08:52:51.636: W/dalvikvm(2999):   510: 0x405228f0 cls=Ljava/lang/
> String; (28 bytes)
> 12-14 08:52:51.640: W/dalvikvm(2999):   511: 0x4000e878 cls=Ljava/lang/
> Class; 'Ljava/lang/String;' (284 bytes)
> 12-14 08:52:51.640: W/dalvikvm(2999): JNI local reference table
> summary (512 entries):
> 12-14 08:52:51.640: W/dalvikvm(2999):     1 of Ljava/lang/Class; 236B
> 12-14 08:52:51.640: W/dalvikvm(2999):   170 of Ljava/lang/Class; 284B
> (1 unique)
> 12-14 08:52:51.640: W/dalvikvm(2999):     1 of Ljava/lang/Class; 572B
> 12-14 08:52:51.640: W/dalvikvm(2999):   168 of [B 36B (168 unique)
> 12-14 08:52:51.640: W/dalvikvm(2999):   171 of Ljava/lang/String; 28B
> (171 unique)
> 12-14 08:52:51.640: W/dalvikvm(2999):     1 of [Ljava/lang/String; 28B
> 12-14 08:52:51.640: W/dalvikvm(2999): Memory held directly by tracked
> refs is 11956 bytes
> 12-14 08:52:51.640: E/dalvikvm(2999): Failed adding to JNI local ref
> table (has 512 entries)
> ++++++
>
> What's the best way to pass the strings to my JNI method?
>
> Regards,

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to