checkForCollisionEllipsoid causing GC Concurrent when called in loop per frame

Started by davec64, December 17, 2013, 05:20:20 AM

Previous topic - Next topic

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:


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!?

davec64

This device is no longer waiting for the request it is going flat out since the 4.4.2 update I think.

public class AnimationTask extends TimerTask {
    public void run() {
      VesselRenderer.animate = true;
      timer.schedule(new AnimationTask(), 40);
      VesselView.openGLView.requestRender();
    }
  }


here is the log just with the collision check that causes the pause the world.
12-18 08:27:04.654: I/jPCT-AE(29576): 27fps
12-18 08:27:05.664: I/jPCT-AE(29576): 33fps
12-18 08:27:06.684: I/jPCT-AE(29576): 37fps
12-18 08:27:07.704: I/jPCT-AE(29576): 37fps
12-18 08:27:08.714: I/jPCT-AE(29576): 26fps
12-18 08:27:09.734: I/jPCT-AE(29576): 27fps
12-18 08:27:10.734: I/jPCT-AE(29576): 36fps
12-18 08:27:11.744: I/jPCT-AE(29576): 38fps
12-18 08:27:12.754: I/jPCT-AE(29576): 38fps
12-18 08:27:13.774: I/jPCT-AE(29576): 37fps
12-18 08:27:14.774: I/jPCT-AE(29576): 37fps
12-18 08:27:15.784: I/jPCT-AE(29576): 38fps
12-18 08:27:16.804: I/jPCT-AE(29576): 38fps
12-18 08:27:17.814: I/jPCT-AE(29576): 38fps
12-18 08:27:18.924: D/dalvikvm(29576): GC_FOR_ALLOC freed 8445K, 13% free 73872K/84676K, paused 143ms, total 143ms
12-18 08:27:18.934: I/jPCT-AE(29576): 37fps
12-18 08:27:19.944: I/jPCT-AE(29576): 38fps
12-18 08:27:20.974: I/jPCT-AE(29576): 38fps
12-18 08:27:21.994: I/jPCT-AE(29576): 36fps
12-18 08:27:22.994: I/jPCT-AE(29576): 38fps
12-18 08:27:24.024: I/jPCT-AE(29576): 38fps
12-18 08:27:25.034: I/jPCT-AE(29576): 35fps
12-18 08:27:26.034: I/jPCT-AE(29576): 25fps
12-18 08:27:27.034: I/jPCT-AE(29576): 26fps
12-18 08:27:28.044: I/jPCT-AE(29576): 28fps
12-18 08:27:29.044: I/jPCT-AE(29576): 25fps
12-18 08:27:30.054: I/jPCT-AE(29576): 31fps
12-18 08:27:31.054: I/jPCT-AE(29576): 27fps
12-18 08:27:32.064: I/jPCT-AE(29576): 25fps
12-18 08:27:33.074: I/jPCT-AE(29576): 36fps
12-18 08:27:34.094: I/jPCT-AE(29576): 38fps
12-18 08:27:35.114: I/jPCT-AE(29576): 32fps
12-18 08:27:36.114: I/jPCT-AE(29576): 32fps
12-18 08:27:37.134: I/jPCT-AE(29576): 27fps
12-18 08:27:38.134: I/jPCT-AE(29576): 35fps
12-18 08:27:39.174: I/jPCT-AE(29576): 30fps
12-18 08:27:40.174: I/jPCT-AE(29576): 32fps
12-18 08:27:41.194: I/jPCT-AE(29576): 38fps
12-18 08:27:41.564: D/dalvikvm(29576): GC_FOR_ALLOC freed 8200K, 13% free 73864K/84676K, paused 145ms, total 145ms
12-18 08:27:42.214: I/jPCT-AE(29576): 33fps
12-18 08:27:43.254: I/jPCT-AE(29576): 32fps
12-18 08:27:44.264: I/jPCT-AE(29576): 29fps
12-18 08:27:45.264: I/jPCT-AE(29576): 30fps
12-18 08:27:46.264: I/jPCT-AE(29576): 29fps
12-18 08:27:47.274: I/jPCT-AE(29576): 26fps
12-18 08:27:48.274: I/jPCT-AE(29576): 31fps
12-18 08:27:49.294: I/jPCT-AE(29576): 33fps
12-18 08:27:50.294: I/jPCT-AE(29576): 38fps
12-18 08:27:51.304: I/jPCT-AE(29576): 37fps
12-18 08:27:52.324: I/jPCT-AE(29576): 38fps
12-18 08:27:53.334: I/jPCT-AE(29576): 38fps
12-18 08:27:54.354: I/jPCT-AE(29576): 38fps
12-18 08:27:55.364: I/jPCT-AE(29576): 38fps
12-18 08:27:56.374: I/jPCT-AE(29576): 38fps
12-18 08:27:57.394: I/jPCT-AE(29576): 38fps
12-18 08:27:58.404: I/jPCT-AE(29576): 38fps
12-18 08:27:59.424: I/jPCT-AE(29576): 38fps
12-18 08:28:00.434: I/jPCT-AE(29576): 38fps
12-18 08:28:01.444: I/jPCT-AE(29576): 38fps
12-18 08:28:02.374: D/dalvikvm(29576): GC_FOR_ALLOC freed 8191K, 13% free 73865K/84676K, paused 145ms, total 145ms
12-18 08:28:02.454: I/jPCT-AE(29576): 32fps
12-18 08:28:03.454: I/jPCT-AE(29576): 26fps
12-18 08:28:04.464: I/jPCT-AE(29576): 27fps
12-18 08:28:05.474: I/jPCT-AE(29576): 35fps
12-18 08:28:06.504: I/jPCT-AE(29576): 38fps
12-18 08:28:07.514: I/jPCT-AE(29576): 34fps
12-18 08:28:08.524: I/jPCT-AE(29576): 26fps
12-18 08:28:09.534: I/jPCT-AE(29576): 38fps
12-18 08:28:10.564: I/jPCT-AE(29576): 26fps
12-18 08:28:11.574: I/jPCT-AE(29576): 25fps


EgonOlsen

...i see...and i still wonder why it does this. Anyway, i mangled the collision code some more and this is the result: http://jpct.de/download/beta/jpct_ae.jar. If all goes well, it creates one SimpleVector-instance per call only. If all goes wrong, it breaks the collision detection. It works for me, but that doesn't mean much. Please give it a try and let me know if it a) works and b) helps. If it doesn't work, it would be great if you can provide me with a test case that works with the former but fails with this version.

davec64

Hi Egon
it works but does not "seem" to help maybe slightly . Would it be possible for the user to pass in the simple vector so that it can be created in the appropriate app constructor.
log included for completeness.

12-18 09:14:23.714: D/dalvikvm(32134): GC_FOR_ALLOC freed 8340K, 34% free 74105K/110696K, paused 166ms, total 166ms
12-18 09:14:23.724: I/jPCT-AE(32134): 31fps
12-18 09:14:24.754: I/jPCT-AE(32134): 30fps
12-18 09:14:25.774: I/jPCT-AE(32134): 27fps
12-18 09:14:26.784: I/jPCT-AE(32134): 33fps
12-18 09:14:27.814: I/jPCT-AE(32134): 33fps
12-18 09:14:28.824: I/jPCT-AE(32134): 32fps
12-18 09:14:29.824: I/jPCT-AE(32134): 33fps
12-18 09:14:30.834: I/jPCT-AE(32134): 33fps
12-18 09:14:31.864: I/jPCT-AE(32134): 34fps
12-18 09:14:32.864: I/jPCT-AE(32134): 33fps
12-18 09:14:33.884: I/jPCT-AE(32134): 34fps
12-18 09:14:34.894: I/jPCT-AE(32134): 33fps
12-18 09:14:35.924: I/jPCT-AE(32134): 33fps
12-18 09:14:36.944: I/jPCT-AE(32134): 33fps
12-18 09:14:37.964: I/jPCT-AE(32134): 33fps
12-18 09:14:38.964: I/jPCT-AE(32134): 32fps
12-18 09:14:39.964: I/jPCT-AE(32134): 33fps
12-18 09:14:40.974: I/jPCT-AE(32134): 28fps
12-18 09:14:42.014: I/jPCT-AE(32134): 32fps
12-18 09:14:43.044: I/jPCT-AE(32134): 34fps
12-18 09:14:44.074: I/jPCT-AE(32134): 34fps
12-18 09:14:45.084: I/jPCT-AE(32134): 33fps
12-18 09:14:46.154: I/jPCT-AE(32134): 33fps
12-18 09:14:47.174: I/jPCT-AE(32134): 28fps
12-18 09:14:48.184: I/jPCT-AE(32134): 28fps
12-18 09:14:49.154: D/dalvikvm(32134): GC_FOR_ALLOC freed 8192K, 34% free 74105K/110696K, paused 172ms, total 172ms
12-18 09:14:49.194: I/jPCT-AE(32134): 25fps
12-18 09:14:50.204: I/jPCT-AE(32134): 29fps
12-18 09:14:51.204: I/jPCT-AE(32134): 30fps
12-18 09:14:52.214: I/jPCT-AE(32134): 31fps
12-18 09:14:53.224: I/jPCT-AE(32134): 27fps
12-18 09:14:54.234: I/jPCT-AE(32134): 28fps
12-18 09:14:55.244: I/jPCT-AE(32134): 28fps
12-18 09:14:56.244: I/jPCT-AE(32134): 26fps
12-18 09:14:57.254: I/jPCT-AE(32134): 32fps
12-18 09:14:58.274: I/jPCT-AE(32134): 33fps
12-18 09:14:59.294: I/jPCT-AE(32134): 33fps
12-18 09:15:00.304: I/jPCT-AE(32134): 33fps
12-18 09:15:01.314: I/jPCT-AE(32134): 33fps
12-18 09:15:02.324: I/jPCT-AE(32134): 33fps
12-18 09:15:03.334: I/jPCT-AE(32134): 33fps
12-18 09:15:04.344: I/jPCT-AE(32134): 33fps
12-18 09:15:05.364: I/jPCT-AE(32134): 33fps
12-18 09:15:06.364: I/jPCT-AE(32134): 33fps
12-18 09:15:07.384: I/jPCT-AE(32134): 33fps
12-18 09:15:08.394: I/jPCT-AE(32134): 32fps
12-18 09:15:09.424: I/jPCT-AE(32134): 33fps
12-18 09:15:10.444: I/jPCT-AE(32134): 33fps
12-18 09:15:11.454: I/jPCT-AE(32134): 33fps
12-18 09:15:12.474: I/jPCT-AE(32134): 33fps
12-18 09:15:13.494: I/jPCT-AE(32134): 29fps
12-18 09:15:14.494: I/jPCT-AE(32134): 27fps
12-18 09:15:15.074: D/dalvikvm(32134): GC_FOR_ALLOC freed 8191K, 34% free 74106K/110696K, paused 166ms, total 166ms
12-18 09:15:15.514: I/jPCT-AE(32134): 25fps
12-18 09:15:16.514: I/jPCT-AE(32134): 29fps
12-18 09:15:17.524: I/jPCT-AE(32134): 33fps
12-18 09:15:18.524: I/jPCT-AE(32134): 33fps
12-18 09:15:19.534: I/jPCT-AE(32134): 26fps
12-18 09:15:20.544: I/jPCT-AE(32134): 27fps
12-18 09:15:21.544: I/jPCT-AE(32134): 29fps
12-18 09:15:22.554: I/jPCT-AE(32134): 28fps
12-18 09:15:23.564: I/jPCT-AE(32134): 29fps
12-18 09:15:24.574: I/jPCT-AE(32134): 26fps
12-18 09:15:25.604: I/jPCT-AE(32134): 28fps
12-18 09:15:26.614: I/jPCT-AE(32134): 29fps
12-18 09:15:27.624: I/jPCT-AE(32134): 33fps
12-18 09:15:28.624: I/jPCT-AE(32134): 32fps
12-18 09:15:29.644: I/jPCT-AE(32134): 33fps
12-18 09:15:30.654: I/jPCT-AE(32134): 33fps
12-18 09:15:31.674: I/jPCT-AE(32134): 33fps
12-18 09:15:32.684: I/jPCT-AE(32134): 33fps
12-18 09:15:33.704: I/jPCT-AE(32134): 33fps
12-18 09:15:34.714: I/jPCT-AE(32134): 33fps
12-18 09:15:35.724: I/jPCT-AE(32134): 33fps
12-18 09:15:36.744: I/jPCT-AE(32134): 33fps
12-18 09:15:37.754: I/jPCT-AE(32134): 33fps
12-18 09:15:38.774: I/jPCT-AE(32134): 33fps
12-18 09:15:39.794: I/jPCT-AE(32134): 33fps
12-18 09:15:40.824: I/jPCT-AE(32134): 34fps
12-18 09:15:40.994: D/dalvikvm(32134): GC_FOR_ALLOC freed 8192K, 34% free 74105K/110696K, paused 168ms, total 168ms
12-18 09:15:41.834: I/jPCT-AE(32134): 22fps
12-18 09:15:42.844: I/jPCT-AE(32134): 29fps
12-18 09:15:43.854: I/jPCT-AE(32134): 29fps
12-18 09:15:44.854: I/jPCT-AE(32134): 32fps
12-18 09:15:45.864: I/jPCT-AE(32134): 33fps
12-18 09:15:46.864: I/jPCT-AE(32134): 32fps
12-18 09:15:47.874: I/jPCT-AE(32134): 30fps
12-18 09:15:48.884: I/jPCT-AE(32134): 30fps
12-18 09:15:49.894: I/jPCT-AE(32134): 33fps
12-18 09:15:50.924: I/jPCT-AE(32134): 33fps
12-18 09:15:51.924: I/jPCT-AE(32134): 33fps
12-18 09:15:52.924: I/jPCT-AE(32134): 30fps
12-18 09:15:53.934: I/jPCT-AE(32134): 26fps
12-18 09:15:54.944: I/jPCT-AE(32134): 25fps
12-18 09:15:55.954: I/jPCT-AE(32134): 29fps
12-18 09:15:56.954: I/jPCT-AE(32134): 25fps
12-18 09:15:57.974: I/jPCT-AE(32134): 29fps
12-18 09:15:58.984: I/jPCT-AE(32134): 33fps
12-18 09:15:59.994: I/jPCT-AE(32134): 30fps
12-18 09:16:00.994: I/jPCT-AE(32134): 30fps
12-18 09:16:02.004: I/jPCT-AE(32134): 29fps
12-18 09:16:03.014: I/jPCT-AE(32134): 27fps
12-18 09:16:04.024: I/jPCT-AE(32134): 29fps
12-18 09:16:05.054: I/jPCT-AE(32134): 31fps
12-18 09:16:06.064: I/jPCT-AE(32134): 27fps
12-18 09:16:07.064: I/jPCT-AE(32134): 27fps
12-18 09:16:08.074: I/jPCT-AE(32134): 25fps
12-18 09:16:08.404: D/dalvikvm(32134): GC_FOR_ALLOC freed 8191K, 34% free 74105K/110696K, paused 163ms, total 163ms
12-18 09:16:09.094: I/jPCT-AE(32134): 27fps
12-18 09:16:10.094: I/jPCT-AE(32134): 29fps
12-18 09:16:11.104: I/jPCT-AE(32134): 30fps
12-18 09:16:12.114: I/jPCT-AE(32134): 29fps
12-18 09:16:13.114: I/jPCT-AE(32134): 25fps



and from the ouya which is observing the request to render


01-08 20:54:19.960: I/jPCT-AE(630): 26fps
01-08 20:54:20.960: I/jPCT-AE(630): 25fps
01-08 20:54:21.970: I/jPCT-AE(630): 25fps
01-08 20:54:22.980: I/jPCT-AE(630): 25fps
01-08 20:54:23.990: I/jPCT-AE(630): 24fps
01-08 20:54:25.000: I/jPCT-AE(630): 25fps
01-08 20:54:26.000: I/jPCT-AE(630): 25fps
01-08 20:54:27.010: I/jPCT-AE(630): 25fps
01-08 20:54:28.010: I/jPCT-AE(630): 25fps
01-08 20:54:29.020: I/jPCT-AE(630): 25fps
01-08 20:54:30.030: I/jPCT-AE(630): 25fps
01-08 20:54:31.030: I/jPCT-AE(630): 25fps
01-08 20:54:32.050: I/jPCT-AE(630): 25fps
01-08 20:54:32.150: D/dalvikvm(630): GC_CONCURRENT freed 5132K, 19% free 77368K/95495K, paused 5ms+5ms, total 187ms
01-08 20:54:33.080: I/jPCT-AE(630): 26fps
01-08 20:54:34.100: I/jPCT-AE(630): 25fps
01-08 20:54:35.140: I/jPCT-AE(630): 26fps
01-08 20:54:36.150: I/jPCT-AE(630): 25fps
01-08 20:54:37.200: I/jPCT-AE(630): 25fps
01-08 20:54:38.200: I/jPCT-AE(630): 25fps
01-08 20:54:39.210: I/jPCT-AE(630): 25fps
01-08 20:54:40.210: I/jPCT-AE(630): 25fps
01-08 20:54:41.230: I/jPCT-AE(630): 25fps
01-08 20:54:42.260: I/jPCT-AE(630): 26fps
01-08 20:54:43.270: I/jPCT-AE(630): 25fps
01-08 20:54:44.290: I/jPCT-AE(630): 25fps
01-08 20:54:45.290: I/jPCT-AE(630): 25fps
01-08 20:54:46.300: I/jPCT-AE(630): 25fps
01-08 20:54:47.300: I/jPCT-AE(630): 25fps
01-08 20:54:48.310: I/jPCT-AE(630): 25fps
01-08 20:54:49.310: I/jPCT-AE(630): 25fps
01-08 20:54:50.320: I/jPCT-AE(630): 25fps
01-08 20:54:51.330: I/jPCT-AE(630): 25fps
01-08 20:54:52.330: I/jPCT-AE(630): 25fps
01-08 20:54:53.340: I/jPCT-AE(630): 25fps
01-08 20:54:54.340: I/jPCT-AE(630): 25fps
01-08 20:54:54.440: D/dalvikvm(630): GC_CONCURRENT freed 5030K, 19% free 77367K/95495K, paused 6ms+5ms, total 176ms
01-08 20:54:55.350: I/jPCT-AE(630): 25fps
01-08 20:54:56.350: I/jPCT-AE(630): 25fps
01-08 20:54:57.390: I/jPCT-AE(630): 26fps
01-08 20:54:58.400: I/jPCT-AE(630): 25fps
01-08 20:54:59.400: I/jPCT-AE(630): 25fps
01-08 20:55:00.410: I/jPCT-AE(630): 24fps
01-08 20:55:01.420: I/jPCT-AE(630): 25fps
01-08 20:55:02.420: I/jPCT-AE(630): 25fps
01-08 20:55:03.430: I/jPCT-AE(630): 25fps
01-08 20:55:04.430: I/jPCT-AE(630): 25fps
01-08 20:55:05.440: I/jPCT-AE(630): 25fps
01-08 20:55:06.440: I/jPCT-AE(630): 25fps
01-08 20:55:07.450: I/jPCT-AE(630): 25fps
01-08 20:55:08.450: I/jPCT-AE(630): 25fps
01-08 20:55:09.460: I/jPCT-AE(630): 25fps
01-08 20:55:10.460: I/jPCT-AE(630): 25fps
01-08 20:55:11.470: I/jPCT-AE(630): 25fps
01-08 20:55:12.470: I/jPCT-AE(630): 25fps
01-08 20:55:13.480: I/jPCT-AE(630): 25fps
01-08 20:55:14.480: I/jPCT-AE(630): 25fps
01-08 20:55:15.490: I/jPCT-AE(630): 25fps
01-08 20:55:16.500: I/jPCT-AE(630): 25fps
01-08 20:55:16.700: D/dalvikvm(630): GC_CONCURRENT freed 5030K, 19% free 77358K/95495K, paused 4ms+4ms, total 159ms
01-08 20:55:17.500: I/jPCT-AE(630): 25fps
01-08 20:55:18.510: I/jPCT-AE(630): 25fps
01-08 20:55:19.520: I/jPCT-AE(630): 25fps
01-08 20:55:20.560: I/jPCT-AE(630): 26fps
01-08 20:55:21.560: I/jPCT-AE(630): 25fps
01-08 20:55:22.600: I/jPCT-AE(630): 25fps
01-08 20:55:23.610: I/jPCT-AE(630): 25fps
01-08 20:55:24.610: I/jPCT-AE(630): 25fps
01-08 20:55:25.620: I/jPCT-AE(630): 25fps
01-08 20:55:26.620: I/jPCT-AE(630): 25fps
01-08 20:55:27.620: I/jPCT-AE(630): 25fps
01-08 20:55:28.630: I/jPCT-AE(630): 25fps
01-08 20:55:29.630: I/jPCT-AE(630): 25fps
01-08 20:55:30.640: I/jPCT-AE(630): 25fps
01-08 20:55:31.650: I/jPCT-AE(630): 25fps
01-08 20:55:32.680: I/jPCT-AE(630): 25fps
01-08 20:55:33.700: I/jPCT-AE(630): 26fps
01-08 20:55:34.700: I/jPCT-AE(630): 25fps
01-08 20:55:35.710: I/jPCT-AE(630): 25fps
01-08 20:55:36.710: I/jPCT-AE(630): 25fps
01-08 20:55:37.710: I/jPCT-AE(630): 25fps
01-08 20:55:38.720: I/jPCT-AE(630): 25fps
01-08 20:55:38.930: D/dalvikvm(630): GC_CONCURRENT freed 5020K, 19% free 77368K/95495K, paused 6ms+4ms, total 166ms
01-08 20:55:39.730: I/jPCT-AE(630): 25fps
01-08 20:55:40.730: I/jPCT-AE(630): 25fps
01-08 20:55:41.740: I/jPCT-AE(630): 25fps
01-08 20:55:42.740: I/jPCT-AE(630): 25fps
01-08 20:55:43.750: I/jPCT-AE(630): 25fps
01-08 20:55:44.780: I/jPCT-AE(630): 25fps
01-08 20:55:45.800: I/jPCT-AE(630): 25fps
01-08 20:55:46.840: I/jPCT-AE(630): 26fps
01-08 20:55:47.840: I/jPCT-AE(630): 25fps
01-08 20:55:48.850: I/jPCT-AE(630): 25fps
01-08 20:55:49.110: I/dalvikvm(630): Jit: resizing JitTable from 4096 to 8192
01-08 20:55:49.850: I/jPCT-AE(630): 25fps
01-08 20:55:50.860: I/jPCT-AE(630): 25fps
01-08 20:55:51.870: I/jPCT-AE(630): 25fps
01-08 20:55:52.870: I/jPCT-AE(630): 25fps
01-08 20:55:53.880: I/jPCT-AE(630): 25fps
01-08 20:55:54.880: I/jPCT-AE(630): 25fps
01-08 20:55:55.890: I/jPCT-AE(630): 25fps
01-08 20:55:56.890: I/jPCT-AE(630): 25fps
01-08 20:55:57.900: I/jPCT-AE(630): 25fps
01-08 20:55:58.900: I/jPCT-AE(630): 25fps
01-08 20:55:59.910: I/jPCT-AE(630): 25fps
01-08 20:56:00.910: I/jPCT-AE(630): 25fps
01-08 20:56:01.220: D/dalvikvm(630): GC_CONCURRENT freed 5029K, 19% free 77368K/95495K, paused 15ms+5ms, total 186ms
01-08 20:56:01.920: I/jPCT-AE(630): 25fps
01-08 20:56:02.920: I/jPCT-AE(630): 25fps
01-08 20:56:03.930: I/jPCT-AE(630): 25fps
01-08 20:56:04.930: I/jPCT-AE(630): 25fps
01-08 20:56:05.940: I/jPCT-AE(630): 25fps
01-08 20:56:06.960: I/jPCT-AE(630): 25fps
01-08 20:56:07.970: I/jPCT-AE(630): 25fps
01-08 20:56:08.970: I/jPCT-AE(630): 25fps
01-08 20:56:09.980: I/jPCT-AE(630): 25fps
01-08 20:56:10.990: I/jPCT-AE(630): 25fps
01-08 20:56:11.990: I/jPCT-AE(630): 25fps
01-08 20:56:13.000: I/jPCT-AE(630): 25fps
01-08 20:56:14.000: I/jPCT-AE(630): 25fps
01-08 20:56:15.010: I/jPCT-AE(630): 25fps
01-08 20:56:16.010: I/jPCT-AE(630): 25fps
01-08 20:56:17.020: I/jPCT-AE(630): 25fps
01-08 20:56:18.020: I/jPCT-AE(630): 25fps
01-08 20:56:19.030: I/jPCT-AE(630): 25fps
01-08 20:56:20.030: I/jPCT-AE(630): 25fps
01-08 20:56:21.040: I/jPCT-AE(630): 25fps
01-08 20:56:22.040: I/jPCT-AE(630): 25fps


EgonOlsen

I edited your log output to appear within code-tags. Looks nicer this way. Anyway, i'm not convinced that gc events are really triggered by the collision detection alone. One SimpleVector per call can't cause this IMHO. I made myself a test case which does 7 calls to Object3D.checkForCollisionEllipsoid(...), 2 with a recursion depth of 5, 5 with a depth of 1. It takes more than 1.5 minutes after gc kicks in and when it does, it's done in 15ms (Nexus 4 with 4.4.2). The new jar creates 1/20th of the garbage that the old one does...it can't cause the same gc intervals!?

Are you using some strange method like Object3D.setEllipsoidMode(...)? Can you post some information from the allocation tracker?

EgonOlsen

Times like these


GC_CONCURRENT freed 5030K, 19% free 77367K/95495K, paused 6ms+5ms, total 176ms


are no problem. It's a 11ms pause, not a 176ms one...

davec64

my ouya is on version 4.1.2 so that one looks better.
I still see a slight jerk in my propeller motion. I need a better way of animating the propeller smoothly that does not get any timing glitches.
I am not used to not having a sync to frame refresh interrupt to do all my animations.  Still learning learning the java techniques.
Dave