Quote:
Originally Posted by Tom Bottiglieri
1) Any object allocations (using the 'new' operator) cannot be assumed to be constant time, as it is basically just mallocing. System.gc is probably just clearing out a portion of memory large enough to not cause the memory allocator to have to look very far to find a spot. We allocate very infrequently and never in control loops to help with this issue.
2) The garbage collector probably won't need to run much within 15 seconds after you explicitly call it. This could be eating CPU.
|
I do not believe we are allocating anything in our control loops. All our variables are declared and our objects instantiated outside of the loops to avoid memory leaks.
Our CPU usage is around 50% during normal use and 60-65% during auto.
It may just be a coincidence that System.gc() didn't run when we had issues.