Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI ERROR (app bug): local reference table overflow (max=512) #3

Open
wangzi815 opened this issue Sep 28, 2021 · 1 comment
Open

JNI ERROR (app bug): local reference table overflow (max=512) #3

wangzi815 opened this issue Sep 28, 2021 · 1 comment

Comments

@wangzi815
Copy link

2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] JNI ERROR (app bug): local reference table overflow (max=512)
2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] local reference table dump:
2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] Last 10 entries (of 512):
2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] 511: 0x12ceed90 byte[][] (2 elements)
2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] 510: 0x6fd5e0b0 java.lang.Class<byte[]>
2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] 509: 0x12ceea30 java.util.ArrayList
...
see:google-ai-edge/mediapipe#2604

@wangzi815
Copy link
Author

wangzi815 commented Sep 28, 2021

i use the project, @afsaredrisy
your project use the aar mode,i only modify it in solution mode,main code as below.when run 6 minutes,the err produce.
what is the problem?
1、mainactivity
bmpInput.start(
this,
resultIntent.getData(),
hands.getGlContext(),
glSurfaceView.getWidth(),
glSurfaceView.getHeight()));

bmpInput = new BmpInput(this);
bmpInput.setNewFrameListener(textureFrame -> hands.send(textureFrame));

hands.setResultListener(
handsResult -> {
logWristLandmark(handsResult, /showPixelValues=/ false);
glSurfaceView.setRenderData(handsResult);
glSurfaceView.requestRender();
});
2、bmpInput.class:
public void start(Activity activity, Uri videoUri, EGLContext sharedContext, int displayWidth, int displayHeight) {
this.converter = new BitmapConverter(sharedContext, 2);
this.converter.setConsumer(this.newFrameListener);
bitmapProducer = new BmpProducer(activity);
bitmapProducer.setCustomFrameAvailableListner(this.converter);
}
3、BmpProducer.class:
bmp = BitmapFactory.decodeResource(context.getResources(), R.drawable.img2);
public void run(){
while ((true)){
customFrameAvailableListner.onFrame(bmp);
try{
Thread.sleep(10);
}catch (Exception e){
Log.d(TAG,e.toString());
}
}
4、 BitmapConverter.class
private AppTextureFrame nextOutputFrame(Bitmap bitmap) {
int textureName = ShaderUtil.createRgbaTexture(bitmap);
outputFrameIndex = (outputFrameIndex + 1) % outputFrames.size();
destinationHeight = bitmap.getHeight();
destinationWidth = bitmap.getWidth();
setupDestination(outputFrameIndex, textureName);
AppTextureFrame outputFrame = outputFrames.get(outputFrameIndex);
//waitUntilReleased(outputFrame);
//Log.d(TAG,String.format("outputFrameIndex = %d",outputFrameIndex));
return outputFrame;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant