Dynamsoft / barcode-reader-javascript-samples

Samples for Dynamsoft Barcode Reader Javascript edition

Home Page:https://www.dynamsoft.com/barcode-reader/sdk-javascript/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BarcodeScanner does not release resources in `5.read-video-vue`

mattcollier opened this issue · comments

I've made the following simple modifications to the example to demonstrate the behavior here:

https://github.com/Dynamsoft/barcode-reader-javascript-samples/compare/master...digitalbazaar:toggle-scanner?expand=1

By repeating the following steps 5-10 times one can produce the attached performance profile that shows ever increasing resource consumption.

  1. Scan barcode (image upload is good for demo)
  2. Hit the "TOGGLE SCANNER" button
  3. Forcefully run garbage collection using the dev tools
  4. Hit the "TOGGLE SCANNER" button
  5. Repeat 5-10 times

Screenshot from 2022-03-23 18-36-18

After some test, we find it does have memory leak when BarcodeScanner.createInstance().

We need to do more research. We may need a few days.

You can temporarily walkaround the problem with a singleton scanner.

It's a bug in SDK. We have fixed it in dynamsoft barcode reader javascript 9.0.

The vue sample has been updated to 9.0.

Thank you, the profile looks much better.

Screenshot from 2022-03-24 09-33-37