could images size affect memory leak

Hi @hammod-930,

To make some physical objects collide with others (but not necessarily all), you should use collision filters. They are described toward the end of this document:

http://docs.coronalabs.com/guide/physics/collisionDetection/index.html

And then, be sure to link to the “collision filter worksheet” here:

http://forums.coronalabs.com/topic/2128-collision-filters-helper-chart/

I wrote this post a long time ago, but it’s completely valid and it should help you figure out the proper numbers for your collision filters.

Brent

P.S. - remember that if your wall objects are “static” type, anything that collides with them must be “dynamic” type (the default). Objects of “kinematic” type will never collide with “static” or vice-versa. In any physical collision, one of the objects (or both) must be “dynamic”.

@Brent Sorrentino 

with collision filtering I can make object1 collides with object2 avoiding object3, right ?, but I don’t want this, I want the bullet to collide with all objects displayed, but when the bullet collides with the wall I want to remove it, is this possible ?

Yes, of course… you just need to assign some property to objects, like a “.name” or something, and then upon collision, you conditionally compare those properties and take the correct action (or not).

Now that I did assign properties to the wall and it’s (wall.name = “first wall”) and to the bullet (bullet.name = “my bullet”)

can you write for me within this function the code I need, cause it’s easier to understand within sample codes

here’s the function :

  1. function remove_bullet(e)
  2. if e.phase == “ended” then
  3. print("!")
  4. end
  5. end
  6. bullet:addEventListener(“collision”, remove_bullet)

I want to remove the bullet in the collision with wall, can you write me the needed code within the function,

sorry for my english, but it’s not my home language :frowning:

Hello,

It’s best if you refer to the guide on this. There’s an example of assigning “names” to objects and dealing with collisions:

http://docs.coronalabs.com/guide/physics/collisionDetection/index.html

Take care,

Brent

ok, I’ll try,

before 10 mins I was testing my game on my note 3 that has a 3GB of RAM, but the shocking part is that the usage of RAM by the game is 200MB !!! which means low hardware devices will die If this game was played on!!!

do you think it’s because the physics joints ?! I’m using “display.remove(obj)” within transitions instead of “obj:removeSelf()”.

could this be a reason ?!

Hi @hammod-930,

There are any number of things which could be affecting the memory. First, is this core memory or texture memory? Texture memory (from OpenGL textures) can skyrocket pretty fast if you’re not careful how you implement visual objects. Core memory should not be that high, so you’ll need to determine if you’re using plugins, modules that take up a lot of memory, etc. It’s just not clear from an initial report what could be the primary cause.

Brent