Go to Post I WANT MY POOF BALLS! - Cyber Punk 234 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-03-2016, 07:53
richtop richtop is offline
Registered User
AKA: Richard Topolewski
FRC #5053 (Laker Robotics)
Team Role: Mentor
 
Join Date: Nov 2014
Rookie Year: 2013
Location: Waterford, Michigan
Posts: 16
richtop is an unknown quantity at this point
How to debug High CPU utilization in RoboRio running Java

When looking at the CPU utilization trace in the we are running, once teleop starts, we are running at 85-95% and often getting pegged at 100%. I was able to trace the day that this problem started occurring. Logs, prior to March 6th at 1:00pm show the CPU running 25-35% range. I looked at the code we introduced back around then from our github logs (https://github.com/LakerRobotics/FRC...igation?page=2) I found one oddity, corrected that but still the problem remains.

Normally at this point I would use a java profiling tool (jProfile or JVM Monitor are two I am currently looking at for this problem) but before I go figuring out how to install and get those working on the roborio, I was wondering if anybody else had any suggestions on how to track the issue down.

We are, for the most part, using Robot Builder generated code. The one unique thing is some custom Motion control PIDs. The motion Control PIDS is done by some awkward wrapping of the PIDSource, but this code was working before Feb 6th, and was not changed around Feb 6th.

Again any suggestions on how to proceed would be appreciated.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 03-03-2016, 08:20
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
The camera was added Feb 7. I bet that's it.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-03-2016, 08:42
hardcopi hardcopi is offline
Registered User
AKA: Rich Lester
FRC #2959 (The Robotarians)
Team Role: Mentor
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Coloma, MI
Posts: 271
hardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud ofhardcopi has much to be proud of
Re: How to debug High CPU utilization in RoboRio running Java

We don't use Java, but the camera adds some decent cpu usage. Try and lower the frame rate and resolution, or better yet, run it without the camera and see if it drops.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-03-2016, 00:28
richtop richtop is offline
Registered User
AKA: Richard Topolewski
FRC #5053 (Laker Robotics)
Team Role: Mentor
 
Join Date: Nov 2014
Rookie Year: 2013
Location: Waterford, Michigan
Posts: 16
richtop is an unknown quantity at this point
Re: How to debug High CPU utilization in RoboRio running Java

Thanks for pointing me the the camera, it helped.

We took the image to it's smallest size and 1 Frame per second, and CPU dropped slightly. Now it is at about 90% to 100%, but importantly the driver control lag dropped and the functionality that was failing to work is now working again (e.g. the drive straight button). So it seems that there is something other then the camera still hogging the CPU.

We have Image processing code we hope to turn on to align to the goal, but I don't see anyway that the images could possibly be processed if we are always at 90% to 100% CPU.

One thing that has improved or become obvious is that the CPU only goes high while in Teleop, otherwise it is around 35%.

We had to spend time tuning the controls and other things today at day 1 of the tournament, but this is going to be the number one thing to work on very soon.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-03-2016, 21:51
Chase Haddleton's Avatar
Chase Haddleton Chase Haddleton is offline
Software Mentor
FRC #3683 (Team D.A.V.E.)
Team Role: Mentor
 
Join Date: Oct 2015
Rookie Year: 2015
Location: Waterloo
Posts: 8
Chase Haddleton is an unknown quantity at this point
Re: How to debug High CPU utilization in RoboRio running Java

Are you guys displaying a lot of values on SmartDashboard? I've heard from a few other teams that displaying many values (75+) can peg your CPU at 90%+
If you are, try reducing the number of values and see if that helps.
Reply With Quote
  #6   Spotlight this post!  
Unread 13-04-2016, 19:49
abigailthefox's Avatar
abigailthefox abigailthefox is offline
Registered User
FRC #1711 (Raptors)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Traverse City
Posts: 57
abigailthefox has a spectacular aura aboutabigailthefox has a spectacular aura about
Re: How to debug High CPU utilization in RoboRio running Java

Are any of your functions running in a separate thread? If you have many threads running at once, or threads running quickly, you can get CPU problems. We had a CPU problem at our last competition that was solved by removing a thread that no longer had any code running within it, so it was running over and over again within the main operator control loop, moving very quickly and using lots of CPU, but without carrying out any useful robot function.
Reply With Quote
  #7   Spotlight this post!  
Unread 13-04-2016, 20:13
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to debug High CPU utilization in RoboRio running Java


Load the code that was running prior to the appearance of the problem to confirm that the problem goes away.



Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi