Memory and Memory texture

I’ve built my app for android to see how it runs on a real device and it’s a little laggy, so I’ve checked the memory that my app consume on the simuator and I have few questions.

My stats look like this:

MEMORY = 220- 250 KB

MEMORY TECTURE = 15-25

How much memory is too much ?

What memory texture means and how much is too much ?

If my stats look ok what could be the reason that the app laggs ?

thanks too all the helper, much appriciated 

Texture memory contains the images you load. System memory contains everything else, tables, variables, timers, listeners, etc. How much is too much is difficult to answer; it depends on the device you’re using. Some devices have more memory than others, and some devices allow apps to consume more memory than others. Your numbers don’t look that high.

Laggy behavior on the device is not necessarily related to memory consumption, but also to CPU cycles, doing too heavy calculations in enterFrame handlers, etc.

Thank you very much.

So you are saying that the lags might be cause from to much math functions ? it seems reasonable for my app, do you have any idea on what I can do about it ?

You will need to provide code for anyone to assist you. There is no way to tell from your memory outputs what the problem is. Please provide code.  

The best approach is to always keep building and testing on the device while developing. That way you catch performance problems early. But now it’s too late for that, obviously, so there’s really not much else to do than a combination of guessing and commenting things out. Some general things that may cause your app to be slow/laggy:

  • Loading a lot of objects from the disk into memory at the same time

  • Spawning a lot of display objects in general

  • Having too many physics objects, or too complex physics bodies

  • Doing slow operations, such as I/O or complicated calculations, in enterFrame handlers

  • Creating inefficient algorithms like multiple nested loops

Also recommend this guide (it mostly focuses on memory management, but also has some general tips) http://docs.coronalabs.com/guide/basics/optimization/index.html

Texture memory contains the images you load. System memory contains everything else, tables, variables, timers, listeners, etc. How much is too much is difficult to answer; it depends on the device you’re using. Some devices have more memory than others, and some devices allow apps to consume more memory than others. Your numbers don’t look that high.

Laggy behavior on the device is not necessarily related to memory consumption, but also to CPU cycles, doing too heavy calculations in enterFrame handlers, etc.

Thank you very much.

So you are saying that the lags might be cause from to much math functions ? it seems reasonable for my app, do you have any idea on what I can do about it ?

You will need to provide code for anyone to assist you. There is no way to tell from your memory outputs what the problem is. Please provide code.  

The best approach is to always keep building and testing on the device while developing. That way you catch performance problems early. But now it’s too late for that, obviously, so there’s really not much else to do than a combination of guessing and commenting things out. Some general things that may cause your app to be slow/laggy:

  • Loading a lot of objects from the disk into memory at the same time

  • Spawning a lot of display objects in general

  • Having too many physics objects, or too complex physics bodies

  • Doing slow operations, such as I/O or complicated calculations, in enterFrame handlers

  • Creating inefficient algorithms like multiple nested loops

Also recommend this guide (it mostly focuses on memory management, but also has some general tips) http://docs.coronalabs.com/guide/basics/optimization/index.html