Log in or register to post comments

Ground plane runaway memory usage in iOS

June 7, 2019 - 3:35am #1

HI,

I'm having problems with run-away memory usage whilst using ground plane in iOS.  For a long time I thought it was my project, but I've now tried it on a blank project and the memory just keeps increasing.

This will continue until the device becomes unresponsive.  Tested in Unity 2018.3.14, 2018.4.0, 2019.1.5 and vuforia 8.1.7 and 8.1.11.  Occurs on iPhone 6, iPad Air 2 and iPad Pro.   iOS 11 and iOS 12.  Xcode 10.1.

If you stop and restart the positional device tracker it drops right back down then starts climbing again.

This is quite a rapid rise and can cause a device crash in about 30 seconds to a minute on lower memory devices.  I'm pulling my hair out over this one as it is preventing us launching a client app.

This example project above consists of ARCamera, Plane Finder, Ground Plane Stage and a single primitive Cube.

Any ideas????

Many thanks,

Graham

 

Ground plane runaway memory usage in iOS

July 25, 2019 - 8:42am #11

Hello @mustarddesign,

We recommend against using INITIALIZING poses as if they were NORMAL poses. We return the INITIALIZING state because of the possibility of the very type of camera pose resets you're observing during this phase.This may seem frustrating, but there are good reasons as to what is occurring under-the-hood during the INITIALIZING phase: estimate gravity direction, sensor biases, camera-IMU timestamp offsets, and the scale of the scene. These resets are also preventing the memory leak previously observed (why you didn't observe it in the previous version of Vuforia).

If you are observing 40-45 seconds for Ground Plane to get out of INITIALIZING mode, then we suggest UX changes that encourage the user to move around a bit during this phase. Exiting INITIALIZING mode requires a certain amount of translational motion - this allows Engine SDK to estimate the scene depth. If the device is close to the scene, then the translational movement may be quite small (a few cm, or even less), but if further away it may need to be bigger (up to a meter).

If you're observing memory usage increasing rapidly during the first few seconds of INITIALIZING, then this is expected as we are using this period to capture keyframes. Once we have enough, then memory usage slows a bit and we just have the normal increase associated with building a larger Ground Plane map over time.

Thanks,

Vuforia Engine Support

Ground plane runaway memory usage in iOS

July 23, 2019 - 11:18am #10

We have found that the runaway memory usage doesn't happen now in the new version of Vuforia, as long as you wait for Initializing to go the *first time*.  If you call reset and it goes to initialising again then the run away memory usage doesn't appear to occur.

This means we can use the device pose while it is saying initialising, as long as we have had a NORMAL or RELOCALIZING at some point in-between.

HOWEVER, we are now seeing another issue.  If the status isn't NORMAL, then we are getting an event every couple of seconds or so saying RELOCALISING, then immediately INITIALISING.  This wouldn't be a major issue, however whenever this occurs the pose of the AR Camera is reset to roughly (exactly?) the same spot. This is frustrating as the device pose seems really stable and accurate whilst it is reporting initialising, but this reset every few seconds causes the pose to jump. 

If we just wait for NORMAL then it can take 45 seconds or more quite often (but does stop this frustrating jump), which is obviously a bit frustrating for users!!  I created a test project and it didn't exhibit this issue in the previous version of Vuforia.

@medabit Do you have any suggestions on how to prevent this occurring?  We are a bit stuck on preventing this, I can't find any function in the documentation to resolve this or prevent this continuous resetting of the pose. We would like to use this pose information before we get the NORMAL status, but this jumping is causing us issues.

Many thanks,

Graham

Ground plane runaway memory usage in iOS

July 23, 2019 - 1:32am #9

A follow up to this, we have tried it with the latest version of vuforia and see the same issues if we don't wait for it to no longer return initialising.

This is a shame as whilst it is returning initialising it does still allow decent stable hit testing, however instead we have to wait for this initialising to stop (which sometimes takes upto 40 seconds).  It seems to only really be an issue on pre-ARKit devices and Android.  ARKit devices seem to no longer be initialising pretty much immediately.

 

Ground plane runaway memory usage in iOS

June 18, 2019 - 9:33am #8

In my initial testing it seems to be massively improved.  There is still a gradual increase in memory (although I haven't proven this isn't an unrelated memory leak), but no where near the steep climb we were seeing before.

Many thanks,

Graham

Ground plane runaway memory usage in iOS

June 11, 2019 - 11:12am #7

Thanks @mustarddesign. Looking forward to your feedback.

-Vuforia Engine Support

Ground plane runaway memory usage in iOS

June 11, 2019 - 10:16am #6

Thank you, I will try this out over the next couple of days and report back any further issues.

Ground plane runaway memory usage in iOS

June 11, 2019 - 9:43am #5

Hello,

We believe we have fixed this issue in our upcoming commercial release (soon).

Our recommendations for working around this issue are:

  1. Reset the DeviceTracker after ~5 seconds if it is still reporting poses with "initializing" status
  2. Avoid performing hit tests whilst the Tracker is reporting poses with "initializing" status info

Thanks,

Vuforia Engine Support

Ground plane runaway memory usage in iOS

June 11, 2019 - 1:16am #4

Thank you, this is getting quite urgent for us as we have a fixed deadline for a launch in a few weeks time, so any help would be great.

It's slightly odd as the fast rise doesn't start immediately.  The actual placement of the object happens at the first step rise in memory, then it's probably about 3 or so seconds of relative stability before the fast climb of memory usage.

Oddly enough it doesn't report this memory usage in Unity if you connect the profiler, only in Xcode.  it's definately occurring though as soon as it is near the memory limit the device will hang.

Ground plane runaway memory usage in iOS

June 10, 2019 - 2:51pm #3

Hello,

Thanks for the report. We'll attempt to replicate.

-Vuforia Engine Support

Ground plane runaway memory usage in iOS

June 10, 2019 - 2:16am #2

Now I know why my app is crashing on iOS after a while . . .

Log in or register to post comments