mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Memory leak of facemesh javascript solution with iris detection

Open shirlyyang-tcc opened this issue 3 years ago • 2 comments

System information (Please provide as much relevant information as possible)

  • no
  • Chrome 105.0.5195.102
  • 0.4.1629159166
  • Bazel version:no
  • Solution (e.g. FaceMesh, Pose, Holistic):FaceMesh
  • Programming Language and version ( e.g. C++, Python, Java):JavaScript

I am developing a AR application on Web and recently we discovered that facemesh has the problem of memory leaking in version 0.4.1629159166 and 0.4.1633559619. And I tested version 0.4.1628005669 it does not have the same problem. But my application do need iris data while version 0.4.1628005669 does not support.

I checked the code that initialize() is called only once and image is sent after last onResult() was triggered.

I alse tested in offical demo (https://codepen.io/mediapipe/details/KKgVaPJ) and it causes memory leaks too. The image is the heapshot of facemesh in offical demo in which snapshot2 is taken 2 minutes after snapshot1. 企业微信截图_c2128243-721e-437b-961d-c5ae4bd72d45 As can be seen the main increase comes from HEAP32 arraybuffer. image 企业微信截图_a085eed7-0aa3-40d8-8058-75ad33ce42d8

Is there any way to solve this problem in the iris versions or is it possible? Really urgent and looking forward to responses.

shirlyyang-tcc avatar Sep 08 '22 03:09 shirlyyang-tcc

Hi @shirlyyang-tcc, Have you looked at this similar closed issue #1937 and #1937(comment). Please try the suggestion and revert back if further queries. Thank you!

kuaashish avatar Sep 08 '22 06:09 kuaashish

Hi @shirlyyang-tcc, Have you looked at this similar closed issue #1937 and #1937(comment). Please try the suggestion and revert back if further queries. Thank you!

Yes I did read this issue and tryed the suggestions in the issue. I did check the code and reassured the face mesh was not initialize multiple times. An I tested the versions decribed in this response:https://github.com/google/mediapipe/issues/1937#issuecomment-1039587436. As it describes versions 0.4.1629159166 and now 0.4.1633559619 both have memory leaks, version 0.4.1628005669 does not have the problem but it does not support iris detection. Our application needs iris detection so we can't use version 0.4.1628005669. So the problem still exists.

shirlyyang-tcc avatar Sep 08 '22 06:09 shirlyyang-tcc

Hello @shirlyyang-tcc, We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediaPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.

You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions.

kuaashish avatar May 02 '23 09:05 kuaashish

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar May 10 '23 01:05 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar May 17 '23 01:05 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar May 17 '23 01:05 google-ml-butler[bot]