AppStudio for ArcGIS / Memory leaks

2617
12
01-10-2017 06:53 AM
RodrigoPintos
New Contributor II

Hi, im working with the AppStudio for ArcGIS and I noticed that the memory is not released properly in many applications made by Esri like Palm Spring Map Tour, Map Tour, Survey 123 (when i use de barcode scanner)

BarcodeDecoder:

I'm developing an application where i have to use a barcode scanner and after some failed barcode scanning the memory usage increase too much.
As i was having troubles with it, I downloaded and used exactly the same code of the survey 123 to decode barcodes and I still having the same behaviour.

The same happens with the barcode scanner of the AppStudio Player.

Map:

AppStudio for ArcGIS / Map memory leaks 

I attached some videos

Any help will be greatly appreciated.

0 Kudos
12 Replies
RodrigoPintos
New Contributor II

I also test what you told me, I take only one Image, and try by decoding repeatedly and i got memory leaks so I think the problem is with the BarcodeDecoder controler when decoding

0 Kudos
StephenQuan1
Esri Contributor

Hi Rodrigo,

Our QR code scanner has two modes.

One, as you discovered, takes a screenshot and analyses the screenshot, aka. scanMode = scanModeGrab.

From what you're saying, there appears to be a memory leak within scanGrab() which we need to narrow down. Your last conclusion is it is possibly withing the BarcodeDecoder itself, but, I just wanted to be sure.

The other scan mode, scanMode = scanModeCapture takes a photo and saves it to a JPEG file which we subsequently use to process the image. Can you try switching to this mode to see if the memory utilization is, either, better, same or worse?

Stephen

0 Kudos
RodrigoPintos
New Contributor II

Hi Stephen,

I have tested the application again, this time with scanMode = scanModeCapture. I took an image and I started decoding it repeatedly. The memory is still leaking. 

In my opinion, the problem is in the BarDecoder component which is not releasing the memory properly.

In the  AppStudioPlayer-BarCodeScanner.mp4. video I attached previously, you can see how "Scan QR Code" within AppStudio Player, has the same behaviour.

In both videos , the upper leftmost part of the screen show the decrement of memory for each barcode scan.

PD.

I would suggest to make the following changes to  survey123 ( in order to destroy "res" after grabToImage)

videoOutput.grabToImage(function(res) {
                .......
                res.destroy();
            } );

and perhaps make the imageObject dynamic.
0 Kudos