1 2 Previous Next 17 Replies Latest reply on Feb 23, 2008 12:14 AM by jschellSomeoneStoleMyAlias

    why does the performance goes bad inside a loop when they are many iteratio

      Hi I have a doubt. for example.

      I have:
      for (int i=0;i<32000;i++) {
             do_some_light_work ();
      now the problem is that the first 1000 iterations goes very fast but then it began to be each time more and more slow for each iteration. the work I am doing on each iteration is always the same so its not due to do_some_light_work (); takes more time. I also have tested calling to System.gc () on each 50 iterations but it always become slower.

      How can I fix this.
        1 2 Previous Next