Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6915913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:32:06+00:00 2026-05-27T09:32:06+00:00

jstring Java_com_example_hellojni_HelloJni_buildString(JNIEnv *env, jobject sThis){ for (int i=0; i < 100000; i++){ char* c=(char*)env->NewStringUTF(xx);

  • 0
    jstring Java_com_example_hellojni_HelloJni_buildString(JNIEnv *env, jobject sThis){
        for (int i=0; i < 100000; i++){
              char* c=(char*)env->NewStringUTF("xx");
        }

        return env->NewStringUTF("test");
    }

12-04 14:46:36.399: DEBUG/dalvikvm(8086): Trying to load lib
/data/data/com.example.hellojni/lib/libhello-jni.so 0x405143d8 12-04
14:46:36.399: DEBUG/dalvikvm(8086): Added shared lib
/data/data/com.example.hellojni/lib/libhello-jni.so 0x405143d8 12-04
14:46:36.431: WARN/dalvikvm(8086): ReferenceTable overflow (max=1024)
12-04 14:46:36.431: WARN/dalvikvm(8086): Last 10 entries in JNI local
reference table: 12-04 14:46:36.431: WARN/dalvikvm(8086): 1014:
0x4052b258 cls=Ljava/lang/String; (28 bytes) 12-04 14:46:36.431:
WARN/dalvikvm(8086): 1015: 0x4052b298 cls=Ljava/lang/String; (28
bytes) 12-04 14:46:36.431: WARN/dalvikvm(8086): 1016: 0x4052b2d8
cls=Ljava/lang/String; (28 bytes) 12-04 14:46:36.431:
WARN/dalvikvm(8086): 1017: 0x4052b318 cls=Ljava/lang/String; (28
bytes) 12-04 14:46:36.431: WARN/dalvikvm(8086): 1018: 0x4052b358
cls=Ljava/lang/String; (28 bytes) 12-04 14:46:36.431:
WARN/dalvikvm(8086): 1019: 0x4052b398 cls=Ljava/lang/String; (28
bytes) 12-04 14:46:36.431: WARN/dalvikvm(8086): 1020: 0x4052b3d8
cls=Ljava/lang/String; (28 bytes) 12-04 14:46:36.431:
WARN/dalvikvm(8086): 1021: 0x4052b418 cls=Ljava/lang/String; (28
bytes) 12-04 14:46:36.431: WARN/dalvikvm(8086): 1022: 0x4052b458
cls=Ljava/lang/String; (28 bytes) 12-04 14:46:36.431:
WARN/dalvikvm(8086): 1023: 0x4052b498 cls=Ljava/lang/String; (28
bytes) 12-04 14:46:36.431: WARN/dalvikvm(8086): JNI local reference
table summary (1024 entries): 12-04 14:46:36.431: WARN/dalvikvm(8086):
1 of Ljava/lang/Class; 236B 12-04 14:46:36.431: WARN/dalvikvm(8086):
1 of Ljava/lang/Class; 284B 12-04 14:46:36.431: WARN/dalvikvm(8086):
1 of Ljava/lang/Class; 572B 12-04 14:46:36.431: WARN/dalvikvm(8086):
1020 of Ljava/lang/String; 28B (1020 unique) 12-04 14:46:36.431:
WARN/dalvikvm(8086): 1 of [Ljava/lang/String; 28B 12-04
14:46:36.431: WARN/dalvikvm(8086): Memory held directly by tracked
refs is 29680 bytes 12-04 14:46:36.431: ERROR/dalvikvm(8086): Failed
adding to JNI local ref table (has 1024 entries) 12-04 14:46:36.431:
INFO/dalvikvm(8086): “main” prio=5 tid=1 RUNNABLE 12-04 14:46:36.431:
INFO/dalvikvm(8086): | group=”main” sCount=0 dsCount=0
obj=0x4001f1b8 self=0xcee8 12-04 14:46:36.431: INFO/dalvikvm(8086):
| sysTid=8086 nice=0 sched=0/0 cgrp=default handle=-1345006496 12-04
14:46:36.431: INFO/dalvikvm(8086): at
com.example.hellojni.HelloJni.buildString(Native Method) 12-04
14:46:36.431: INFO/dalvikvm(8086): at
com.example.hellojni.HelloJni.onCreate(HelloJni.java:93)

weird. if my for next looks like this:

for (int i=0; i < 100; i++){

then evreything ok.

How can I rewrite this code to run the for next with a big number?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:32:06+00:00Added an answer on May 27, 2026 at 9:32 am

    if you are invoking this method from the UI thread then it will pause for 1.4 minutes and android will close any program that does not respond for 5 seconds my this help you try to use AsyncTask or execute this call in another thread .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following C code segments. Segment 1: char * getSomeString(JNIEnv *env, jstring jstr)
I have the following native routine: void sendMessage(const char* text) { JNIEnv* env; if(!_jvm)
The C++ side looks like this: JNIEXPORT jint JNICALL Java_Myclass_showMessage (JNIEnv* env, jobject obj,
I'm having problems converting a wstring to jstring in unix, as the size of
Is there a way to use the lift-json library's JObject class to act like
dev env: Ubuntu 10.10 (32-bit), Eclipse, OpenJDK I currently have code for an executable
While there is documentation regarding turning a jstring to a native string ( string
I have a local String in a method like so: String jString = new
I have been trying to return an ARABIC string from a JNI call. The
Id like to make a simple function, that return value of two Strings, basically:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.