jPCT-AE - a 3d engine for Android > Support

checkForCollisionEllipsoid causing GC Concurrent when called in loop per frame

(1/3) > >>

davec64:
I am calling checkForCollisionEllipsoid to detect collisions around a polygon in 6 places per frame.
I am running at 25 fps and at around 15 seconds the GC kicks off pausing my app by 200ms.
Removing this check stops the pause.
Dave

 

kiffa:
I have the same issue in my game. You can use the android's tools which called "Allocation Tracker" to see the detail of memory allocations.

Providing a method with some params of  buffer which are provided and managed by user could be a choice. But I hope there could be an internal improvement without damaging the current clean & simple api-designs.

EgonOlsen:
Object creation in the collision methods has already been reduced to the bare minimum of what could be achieved without introducing weird structures that the user would have to be aware of to use properly. To be honest, i haven't seen this to be an issue for quite some time now, so i wonder why it is in your game...which Android version are you using? I haven't seen a stop-the-world-for-200ms garbage collection since 2.1.

There are three options to reduce the amount of objects being created:


* Try to limit the recursion depth to a minimum
* Try to limit the usage of a CollisionListener (IF you are using it) and consider to use polling instead:http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#wasTargetOfLastCollision()
* If you are using calcMinDistanceAndObject3D, try to use calcMinDistance instead if you don't need the Object3D
I addition, i will have a look (again...) at the methods to see if there is something left to be done, but i don't expect much.

davec64:
Version 4.4.2 nexus 7 and an ouya cube

No collision listner
Recursion set to 1
I am sort of cheating with the collision detection I have rectangle object as a child of my ship. I also have cylinder object as a child of the ship I move the rectangle in the opposite angles to the ship which gives me an easy way to detect the lowest depth of the ship at any point on the rectangle, when I check for a collision by moving my cylinder around the ship hull. As the ship could be in any rotation the cylinder must also stay in the correct rotation.
It works fantastic for a few lines of code.

EgonOlsen:
On Android 4.x, the gc usually doesn't stop-the-world for 200ms...can you post a section of the log output that shows this!?

Navigation

[0] Message Index

[#] Next page

Go to full version