This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Building my project

 
Ryan James
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using netbeans, and am trying to run and compile my program - however when I press build and run java spikes to 98% CPU usage, I left it for 15 minutes just incase the main function of the program may take a bit longer to run however on a 3ghz machine, which 1.5gb of RAM it seems odd:



My friend suggested adding the Thread.sleep to it to space out the program, the main function is of course to find all even fibonacci numbers below 4 million and add them together, can anyone see a reason the program is causing such an issue to compile.
 
Bill Cruise
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without looking for problems anywhere else, I see that this line

while (c <= 4000000);

loops forever. Remove that semicolon and try it again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic