Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

App running out of usable memory!

Nitesh96Nitesh96 PhilippinesPosts: 1New Users Noob
Hey guys! So this is my first question, don't be too harsh please. I have an app that creates a mask image from a view then masks an image. This happens a lot of times since i do it in the touchesMoved method. In instruments my live bytes are in the normal range 2-3MB max but since I'm allocating and releasing memory very quickly my overall bytes quickly accumulate to 1GB-2GB. After a while my app doesn't have a memory address to allocate memory to. How can i fix this?

r0UmHOJ.png

Replies

  • RickSDKRickSDK Posts: 1,236Registered Users @ @ @ @
    edited August 2013
    if you already have the image, why would you need to re-create is thousands of times? that doesn't make sense. touchesMoved method gets called constantly and should not have any heavy coding in it. Even if you app "works" it is likely extremely laggy and unusable.

    There's got to be a better approach.

    The only thing you should be doing in touchesMoved is moving your image. thats it.

    touchesBegan is where you want to do this work.
  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,676Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    Posting only an Instruments screen shot is not going to achieve your goal of getting a solution. Posting both of the following will increase your chances tremendously:

    1. The code you are running.
    2. A picture or video of what you are doing (in case a better approach to #1 exists).
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | BTICoreDataKit | SlickShopper 2 | Leave a PayPal donation
Sign In or Register to comment.