Log in or register to post comments

QCAR memory leaks

July 3, 2012 - 6:41pm #13

hi, im in the final stages of polishing up my app for submission to app store.

im going through and making sure there are no leaks in my app but im seeing quite a lot leaks springing up from QCAR.

using xcode instruments on ImageTargets example, im getting the same results.

 

they seem to start from,

[QCARutils initQCAR]

and

[QCARutils loadDataSet:]

 

this leads me to believe its something internal to QCAR.

also instruments seems to think the leaked object is either QCAR::Area or QCAR::Rectangle

 

could you please advise if there is anything i can do from my end?

i need to get these leaks fixed before submitted my app, otherwise it might not pass the approval process.

 

thanks,

Lukasz.

QCAR memory leaks

July 4, 2012 - 2:21am #12

Hi Lukasz

This seems strange as I have just run the leaks profiler on Imaget Targets "out of the box" over a period of 2 minutes and here are my obesrvations:

  • Overall bytes allocated seems steady at around 6.86 Mb
  • After about 6 seconds it discovered 61 leaks totalling 1.02KB
  • 17 seonds - 6 leaks totalling 128 bytes
  • 52 seconds - 4 leaks totalling 160 bytes
  • 1:15 seconds - 2 leaks totaling 80 bytes

Are you seeing something similar?  If so then it may not be a showstopper as the leaks are quite small and the overall memory usage remains steady.

If not, then something must be different in your code.  Could you please check and clarify?  Probably best to PM me :)

We can look into the leaks in due course.

 

N

 

 

QCAR memory leaks

July 5, 2012 - 5:34pm #11

hi,

thx for looking into this.

im also running out of the box ImageTargets example and can confirm im receiving the same results you have mentioned.

 

my app also accesses the camera pixels to do some further computer vision processing...

so what i did was was insert a bit of code that i use for getting the camera pixels into the ImageTargets example.

 

    QCAR::State state = QCAR::Renderer::getInstance().begin();

    QCAR::Renderer::getInstance().drawVideoBackground();


    if([QCARutils getInstance].appStatus == APPSTATUS_CAMERA_RUNNING) {

        QCAR::Frame frame = state.getFrame();

        const QCAR::Image * image = frame.getImage(0);

        if(image) {

            image->getBufferWidth();

            image->getBufferHeight();

            (unsigned char *)image->getPixels();

        }

    }

 

this seems to be leaks about 20KB every 10 seconds.

instruments in attributing the leak to state.getFrame() but it could something to do with accessing the pixels.

please let me know what you find.

 

L.

 

QCAR memory leaks

July 6, 2012 - 6:11am #10

Hi Lukasz

So the core code in Image Targets should be fine (enough), so it must be related to the code you have added.

Two things spring to mind:

  • check where exactly the image you get from getImage is being released - probably would not explain 20K/10 seconds
  • I am assuming you have this at the end:  QCAR::Renderer::getInstance().end();
Apart from this I'm not sure, so you may need to take out code and re-run it untl you find the culprit
 
N

QCAR memory leaks

July 25, 2012 - 11:47pm #9

hi,

sorry for the radio silence, been busy on other work and have just come back to this issue...

to replicate the leak please insert these lines of code in the ImageTargets example right at the end of 
- (void)renderFrameQCAR

if([QCARutils getInstance].appStatus == APPSTATUS_CAMERA_RUNNING) {
    QCAR::Frame frame = state.getFrame();
}

instruments will show a leak of 20k every 10 seconds.

any idea of how i can get around this?

L.

QCAR memory leaks

July 26, 2012 - 3:49am #8

Hi Lukasz

Thanks for this.

We will investigate this further.

N

QCAR memory leaks

July 29, 2012 - 9:22pm #7

hi again,

just thought id touch base again to see if you have any solution for this leak...

i need to get my app into the app store quite soon and i can't do it until i can patch this leak.

is there any way of cirucumventing the use of getFrame() and still get access to camer pixels?

L.

QCAR memory leaks

July 31, 2012 - 8:35pm #6

Sorry, no news as yet.

Currently AFAIK this is the only way to get access to the camera pixels.

Appreciate the need to get the app into the store, but not quite sure what you can do here.

Will let you know if/when there is any news here.

N

QCAR memory leaks

October 17, 2012 - 7:25pm #5

hi there,

its been a few months and just wondering if any progress has been made with this issue?
ive had to disable the computer vision features in my app. 
im keen to finally add it back in but still waiting on this issue to be fixed.

thx,
L. 

 

QCAR memory leaks

October 18, 2012 - 2:53am #4

Hi julapy,

This should be fixed in the next release which will be out in the "fall".

N

QCAR memory leaks

October 18, 2012 - 7:16pm #3

ok thats good to know.
thx for the reply. 

QCAR memory leaks

June 4, 2013 - 7:54am #2

NalinS wrote:

Hi julapy,

This should be fixed in the next release which will be out in the "fall".

N

 

Hi Nalin,

Can you confirm that 2.0.32 or earlier fixes this?

= MoSR =

QCAR memory leaks

June 4, 2013 - 8:01am #1

My understanding is that this has been fixed.

N

Log in or register to post comments