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 8939685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:52:22+00:00 2026-06-15T10:52:22+00:00

I’m implementing a callback function in C++, but I’m facing some leak problems. The

  • 0

I’m implementing a callback function in C++, but I’m facing some leak problems.

The implementation of array creation:

jshortArray convertShortArrayToJNI(JNIEnv* env, short* arr, size_t count) {
  jshortArray retval = env->NewShortArray(count);
  env->SetShortArrayRegion(retval,0,count,arr);
  return retval;
}

Here the callback call:

short* audio_frame;
int size;
jobject* callbackObject;
jshortArray array = convertShortArrayToJNI(jenv, audio_frame, size);
LOGI("array %d", array);
jenv->CallVoidMethod(*callbackObject, callbackMI, array);
LOGI("callback called!");
jenv->ReleaseShortArrayElements(array, audio_frame, 0);

After some calls it’s showed the error below:

12-03 11:12:38.425: W/dalvikvm(894): ReferenceTable overflow (max=512)
12-03 11:12:38.425: W/dalvikvm(894): Last 10 entries in JNI local reference table:
12-03 11:12:38.425: W/dalvikvm(894):   502: 0x44f879b0 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   503: 0x44f87a98 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   504: 0x44f87b80 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   505: 0x44f87c68 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   506: 0x44f87d50 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   507: 0x44f87e38 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   508: 0x44f87f20 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   509: 0x44f88008 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   510: 0x44f880f0 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894):   511: 0x44f881d8 cls=[S (100 bytes)
12-03 11:12:38.435: W/dalvikvm(894): JNI local reference table summary (512 entries):
12-03 11:12:38.435: W/dalvikvm(894):     1 of Ljava/lang/Class; 164B
12-03 11:12:38.435: W/dalvikvm(894):   511 of [S 100B (511 unique)
12-03 11:12:38.435: W/dalvikvm(894): Memory held directly by tracked refs is 51264 bytes

What is wrong?

  • 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-06-15T10:52:23+00:00Added an answer on June 15, 2026 at 10:52 am

    This was the answer: ReferenceTable overflow (max=512) JNI

    Calling jenv->DeleteLocalRef(array); solve my problem!

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.