arcore-unity-sdk icon indicating copy to clipboard operation
arcore-unity-sdk copied to clipboard

Memory problems when adding images (trackers) to AugmentedImageDatabase (runtime)

Open L4Hacks opened this issue 4 years ago • 2 comments

SPECIFIC ISSUE ENCOUNTERED

I have an app that only creates an AugmentedImageDatabase in runtime. When adding images to the database, it takes A LOT of memory from my device (almost all memory). I have used Unity profiler to see this, and i'have also bought an asset (from the AssetStore) to check the current available memory [same results - see the attached picture]).

I'm adding images to the database like this: "Texture2Dtex = new Texture2D(2, 2); tex.LoadImage(fileData); AugmentedImageSrc image = new AugmentedImageSrc(tex); db.AddImage(sceneInfo.Id + "-" + triggerInfo.Id.ToString(), image);"

Each time i call this method, my free RAM drops approximatly 250Mb.

This is a really strange behaviour, since if I start the Scene with a AugmentedImageDatabase already populated (with the same images), i get all the available memory free! Is there any way to realese unused memory after adding the images to the database? Is it possible to serialize the database, destroy everything and load it after (to get free memory)?

Also, is there any way to destroy the database and realease the memory? I cant seem to do this.

VERSIONS USED

  • Unity: 2020.1.4f1
  • ARCore SDK for Unity: 1.19.0
  • Device manufacturer, model, and O/S: Samsung Tab S6, Android 10

ARCore

L4Hacks avatar Oct 19 '20 13:10 L4Hacks

Can anyone help with this? Is there any way to serialize & upload a AugmentedImageDatabase to a server, and download & deserialize it after?

L4Hacks avatar Nov 04 '20 21:11 L4Hacks

almost 1 month later .. thanks for not helping :/

L4Hacks avatar Nov 11 '20 15:11 L4Hacks