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

  • Home
  • SEARCH
  • 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 7538907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:14:28+00:00 2026-05-30T07:14:28+00:00

I am a little stuck with this one… ReferenceTable overflow (max=512), I am sure

  • 0

I am a little stuck with this one…
ReferenceTable overflow (max=512), I am sure it has to do with the Number of Local References getting created in my native method call… To work around the issue I have even tried to remove the local references from the native call; but still I am unable to solve the problem… I am passing a 2D Array; which is approaximately 1024 X 1024 …

Here is the error trace I am referring to … I am sure that number of Integer Objects getting created is causing the issue for my case … as you should be able to see 506(I) Objects are created… And then JNI hits the bottleneck…

/dalvikvm(9498): GC_CONCURRENT freed 1981K, 41% free 6891K/11527K, external 1625K/2137K, paused 2ms+3ms
/dalvikvm(9498): ReferenceTable overflow (max=512)
/dalvikvm(9498): Last 10 entries in JNI local reference table:
/dalvikvm(9498):   502: 0x40710920 cls=[I (4092 bytes)
/dalvikvm(9498):   503: 0x40711920 cls=[I (4092 bytes)
/dalvikvm(9498):   504: 0x40712920 cls=[I (4092 bytes)
/dalvikvm(9498):   505: 0x40713920 cls=[I (4092 bytes)
/dalvikvm(9498):   506: 0x40714920 cls=[I (4092 bytes)
/dalvikvm(9498):   507: 0x40715920 cls=[I (4092 bytes)
/dalvikvm(9498):   508: 0x40716920 cls=[I (4092 bytes)
/dalvikvm(9498):   509: 0x40717920 cls=[I (4092 bytes)
/dalvikvm(9498):   510: 0x40718920 cls=[I (4092 bytes)
/dalvikvm(9498):   511: 0x40719920 cls=[I (4092 bytes)
/dalvikvm(9498): JNI local reference table summary (512 entries):
/dalvikvm(9498):     1 of Ljava/lang/Class; 236B
/dalvikvm(9498):     1 of Ljava/lang/Class; 284B
/dalvikvm(9498):     1 of Ljava/lang/Class; 572B
/dalvikvm(9498):     2 of Ljava/lang/String; 28B (2 unique)
/dalvikvm(9498):   506 of [I 4092B (506 unique)
/dalvikvm(9498):     1 of [Ljava/lang/String; 28B
/dalvikvm(9498): Memory held directly by tracked refs is 2071728 bytes
/dalvikvm(9498): Failed adding to JNI local ref table (has 512 entries)
/dalvikvm(9498): "main" prio=5 tid=1 RUNNABLE
/dalvikvm(9498):   | group="main" sCount=0 dsCount=0 obj=0x4001f198 self=0xce60
/dalvikvm(9498):   | sysTid=9498 nice=0 sched=0/0 cgrp=default handle=-1345006528
/dalvikvm(9498):   | schedstat=( 6990020745 1042358411 1629 )
/dalvikvm(9498):   at pv.ndk.UcMobile.losInitialization(Native Method)
/dalvikvm(9498):   at pv.ndk.NdkActivity.onCreate(NdkActivity.java:69)
/dalvikvm(9498):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
/dalvikvm(9498):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)

Here is the code I am using :
Please let me know what is it that I am doing wrong ?

JNIEXPORT jboolean JNICALL Java_pv_ndk_UcMobile_losInitialization
  (JNIEnv * env, jobject jobj , jint height, jint width , jobjectArray elements){

   elevData = new unsigned int*[height];

for(i=0; i< height; i++) {
    elevData[i] = new unsigned int[width];

    jintArray oneDim=
    (jintArray)env->GetObjectArrayElement(
                         elements, i);
     jint *element=env->GetIntArrayElements(oneDim, 0);
     for(j=0; j< width; j++) {
         elevData[i][j]= element[j];
     }
     // This does not seem to be providing with the desired result
     // env->DeleteLocalRef(element);

     //I even tried with this approach
     env->ReleaseIntArrayElements(oneDim, element , 0);

  }

return losObject.Init(elevData,1,10,2,2);
}
  • 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-30T07:14:30+00:00Added an answer on May 30, 2026 at 7:14 am

    You need to delete local reference from oneDim object: env->DeleteLocalRef(oneDim);.

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

Sidebar

Related Questions

I keep getting stuck on this one little thing. I append a checkbox and
I'm a little stuck on this one, I have a UIButton inside a UIViewController
I'm a little stuck on trying to figure this one out, I think I
I apologize for the subjectiveness of this question, but I am a little stuck
OK, i've been working with this for some time and I'm a little stuck.
Im stuck with this little project in C# but basically my problem is this:
So, I am in this little predicament where I am stuck watching a few
I am a little bit stuck: I would like to change the max option
I am a little stuck on how to create this array. My data: category_id
I have been all over this one, and I am just plumb stuck. I

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.