Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Memory leak in TangoSDK #103

Open
lvonasek opened this issue May 6, 2017 · 4 comments
Open

Memory leak in TangoSDK #103

lvonasek opened this issue May 6, 2017 · 4 comments

Comments

@lvonasek
Copy link

lvonasek commented May 6, 2017

When I use Tango3DR_clear it removes data from it but it does not deallocate memory (it is problem for texturing and reconstruction context). Also Tango3DR_ReconstructionContext_destroy does not deallocate it completely.

I did following test with cpp_mesh_builder_example:
-change resolution: Tango3DR_Config_setDouble(t3dr_config, "resolution", 0.005);
-make it scan more far: Tango3DR_Config_setDouble(t3dr_config, "max_depth", 7.5);
-remove mesh extraction (it is too slow for test)
-do measurement when clear button is pressed:

        text += new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ": ";
        ActivityManager.MemoryInfo mem = new ActivityManager.MemoryInfo();
        ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);

        //pause scanning and measure memory
        TangoJNINative.onToggleButtonClicked(false);
        activityManager.getMemoryInfo(mem);
        text += (mem.availMem / 1048576L) + "MB -> ";

        //clear context
        TangoJNINative.onClearButtonClicked();

        //measure memory and resume scanning
        activityManager.getMemoryInfo(mem);
        text += (mem.availMem / 1048576L) + "MB\n";
        TangoJNINative.onToggleButtonClicked(m3drRunning);

        //show result
        MeshBuilderActivity.this.runOnUiThread(new Runnable()
        {
          @Override
          public void run()
          {
            Toast.makeText(MeshBuilderActivity.this, text, Toast.LENGTH_LONG).show();
          }
        });

result:
tango_hopak_leak

@jchernobieff
Copy link

Thank you for the bug report lvonasek, we are currently looking into it.

@lvonasek
Copy link
Author

Thank you. The problem happens also after calling Tango3DR_TexturingContext_destroy

@lvonasek
Copy link
Author

lvonasek commented Jun 6, 2017

After update on Tango Ikariotikos memory leaks in Tango3DR_TexturingContext seems to be fixed but the problem with Tango3DR_clear still stays

@lvonasek
Copy link
Author

Issue stays in release m20.

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

No branches or pull requests

2 participants