MediaPipeUnityPlugin icon indicating copy to clipboard operation
MediaPipeUnityPlugin copied to clipboard

Sample app consume memory over 600MB

Open siisee11 opened this issue 1 year ago • 4 comments

Plugin Version or Commit ID

v0.10.1

Unity Version

2021.3.4f

Your Host OS

MacOS 12.3

Target Platform

iOS

Target Device

iPhone 12

[Windows Only] Visual Studio C++ and Windows SDK Version

No response

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

No response

[iOS Only] XCode Version

13.4.1

Build Command

Download plugin from release

Bug Description

I built a sample app and it consumed memory of more than 600 MB. I want to reduce memory usage because my app often crashes due to memory limits.

I built <1> including StartScene and Holistic Scene, and built <2> including only StartScene.

And ScreenShots are the profile result.

  1. Can I optimize those texture2Ds that mediapipe use?
  2. What's going on in "Untracked Memory"?

Could you help me to optimize memory?

Steps to Reproduce the Bug

  1. build sample app for ios
  2. run and profile

Log


Screenshot/Video

<1> StartScene + Holistic Scene Screen Shot 2022-09-21 at 3 08 11 PM Screen Shot 2022-09-21 at 3 09 02 PM Screen Shot 2022-09-21 at 3 09 30 PM

<2> only StartScene Screen Shot 2022-09-21 at 3 17 57 PM Screen Shot 2022-09-21 at 3 17 13 PM

Additional Context

No response

siisee11 avatar Sep 21 '22 06:09 siisee11

Reduce webcamtexture resolution on the webcam component in the scene?

ROBYER1 avatar Sep 22 '22 10:09 ROBYER1

@ROBYER1 Sorry for the late reply. I'll check it soon. Do you have an idea what is going on "Untracked Memeory"?

siisee11 avatar Sep 29 '22 01:09 siisee11

@ROBYER1 Sorry for the late reply. I'll check it soon. Do you have an idea what is going on "Untracked Memeory"?

I don't but see if the webcamtexture resolution is the main cause first

ROBYER1 avatar Sep 29 '22 08:09 ROBYER1

I think there is possibility to lower the pooling parameter (default is 10) in TextureFramePool. Btw - don't you think there is a memory leak connected with webcam texture? Those textures seems to not be disposed after changing scenes.

LoopIssuer avatar Dec 22 '22 08:12 LoopIssuer