"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Model Target Crash

Hi everyone, 

I'm new in AR and I'm testing Model Target functionality.

I created the dataset from Model Target Generator and imported it into Android Studio. The Guide Views are displayed correctly in the app, and the model is tracked correctly.

The problem is the crash of the app in the moment of rendering of my model. I have an "OutOfMemoryError" exception. I tried with 3D object with .obj and .v3d extension, but I have the same problems.

Next, the details of the error:

--------- beginning of crash E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4     Process: com.vuforia.engine.CoreSamples, PID: 8460     java.lang.RuntimeException: An error occurred while executing doInBackground()         at android.os.AsyncTask$4.done(AsyncTask.java:399)         at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)         at java.util.concurrent.FutureTask.setException(FutureTask.java:252)         at java.util.concurrent.FutureTask.run(FutureTask.java:271)         at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)         at java.lang.Thread.run(Thread.java:919)      Caused by: java.lang.OutOfMemoryError: Failed to allocate a 701953607 byte allocation with 6275072 free bytes and 490MB until OOM, target footprint 28295840, growth limit 536870912         at dalvik.system.VMRuntime.newNonMovableArray(Native Method)         at java.nio.DirectByteBuffer$MemoryRef.<init>(DirectByteBuffer.java:70)         at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:258)         at com.vuforia.engine.SampleApplication.utils.SampleApplicationV3DModel.loadModel(SampleApplicationV3DModel.java:145)         at com.vuforia.engine.CoreSamples.app.ModelTargets.ModelTargetRenderer$LoadModelTask.doInBackground(ModelTargetRenderer.java:237)         at com.vuforia.engine.CoreSamples.app.ModelTargets.ModelTargetRenderer$LoadModelTask.doInBackground(ModelTargetRenderer.java:220)         at android.os.AsyncTask$3.call(AsyncTask.java:378)         at java.util.concurrent.FutureTask.run(FutureTask.java:266)         at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)          at java.lang.Thread.run(Thread.java:919) 

 

How can I resolve?

 

Thank you

Hi,

As per your description this seems to be similar to an issue that solved in 9.0.12.

Here are the release notes: https://library.vuforia.com/articles/Release_Notes/Vuforia-SDK-Release-Notes;

Could you please upgrade to our latest version, 9.0.12?

Thank you.

dobrucci

Tue, 03/24/2020 - 13:20

In reply to by mcotora

Hi,

Thank you for reply. I have updated at the latest SDK version 9.0.12, but the problem it's the same.

If I load the model "astronaut,v3d" or "drone.v3d", these are correctly rendered.

mcotora

Tue, 03/24/2020 - 13:48

In reply to by dobrucci

Hi,

Could you please confirm the size and polycount of the model?

Also are developing natively on Android or using Unity?

In addition, my recommendation when testing Model Target is to use the Model Target Test app.

dobrucci

Tue, 03/24/2020 - 15:03

In reply to by mcotora

Hi, 

the model is an .obj file with these characteristics:

  • Objects: 1
  • Vertices: 1099
  • Polygon: 83
  • Materials: 1
  • Bones: 1

I tried also to convert it to .v3d file, but the result is the same.

mcotora

Wed, 03/25/2020 - 09:58

In reply to by dobrucci

Hi,

The model should work without any issues. I believe the issue lies in modifying the native Android sample, my recommendation as mentioned earlier is to you use the MT Test app for loading your own model and testing the feature out.

Thank you.

Vuforia Engine Support

dobrucci

Thu, 03/26/2020 - 08:12

In reply to by mcotora

Hi!

Thank you for the support. I tried the Model Target Test app and it tracks my model correctly as you can see in the attached photo.

So, the problem is "my" code. Can I load my 3D Model using ModelRenderable.builder() constructor in ar.sceneform ?

Attachment