View Single Post
  #19   Spotlight this post!  
Unread 02-03-2015, 19:37
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by Tom Bottiglieri View Post
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.