Performance Fluctuation in Java 6
5 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hendrik_Gani
Posted On:   Monday, November 9, 2009 06:30 AM

Hi, Summary of issue: When running a CPU-intensive program, I am getting large performance overhead (which cannot be reproduced consistently but occassionally appears) on Sun JDK 6. But the overhead does not exist when running the same program on Sun JDK 1.4. Please let me know of any possible causes. Thanks. Details: I have got a simple program in which a method containing an empty loop is executed. The number of the times the loop gets executed was calibrated so that the method executes for approximately 1000 milliseconds (i.e. 1 second). The problem is that sometimes the method executes for 1500-1600 milliseconds instead. This can only be reproduced if I rerun the pro   More>>


Hi,



Summary of issue:
When running a CPU-intensive program, I am getting large performance overhead (which cannot be reproduced consistently but occassionally appears) on Sun JDK 6. But the overhead does not exist when running the same program on Sun JDK 1.4. Please let me know of any possible causes. Thanks.



Details:
I have got a simple program in which a method containing an empty loop is executed. The number of the times the loop gets executed was calibrated so that the method executes for approximately 1000 milliseconds (i.e. 1 second).



The problem is that sometimes the method executes for 1500-1600 milliseconds instead. This can only be reproduced if I rerun the program again without changing the code, opening/closing heavy applications (e.g. eclipse), rebooting the machine. But say if I add a println() statement AFTER the loop, the problem disappears but will eventually reappear (e.g. if the code gets changed again, etc.).



I am sure that this has nothing to do with garbage collection or any external programs contending for CPU, because of the following reasons:


  • I ran the program on quad-core and dual-core machines so any external activities should be handled by the other CPU core(s)

  • I have monitored running processes and there does not seem to be significant external interference

  • I don't think garbage collection can slow down my program so significantly since the program does not have many objects

  • More importantly, ThreadMXBean.getCurrentThreadCPUTime() returns me a value of 1500 or 1600 milliseconds, which pretty much says that the thread's CPU usage fluctuates (as opposed to being affected by external threads/processes).




The problem exists when using Sun JDK versions 1.6.0_14 and 1.6.0_17 (on both Windows XP and Vista), but does not happen when using Sun JDK 1.4 (1.4.2_14).



Anyone has any idea why? Does this have anything to do with the profiling or JMX support in later versions of Java runtime environment? Is there any way to fix this?



Thanks,



Hendrik

   <<Less

Re: Performance Fluctuation in Java 6

Posted By:   ngpat  
Posted On:   Saturday, March 30, 2013 02:26 AM

for more detail visit  http://www.troveinterview.com/java-interview-questions/

Re: Performance Fluctuation in Java 6

Posted By:   adamabraham  
Posted On:   Friday, September 7, 2012 12:13 AM

One of the ideas behind Java's automatic memory management model is that programmers can be spared the burden of having to perform manual memory management. In some languages, memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and deallocated from the heap.  Heating spares by Flame Heating Spares

Re: Performance Fluctuation in Java 6

Posted By:   alfredalfie  
Posted On:   Thursday, June 14, 2012 03:09 AM

 

 

 

Unlike Java applets, Web Start applications do not run inside the browser. However by default they run in the same sandbox as applets, with several minor extensions like allowing to load and save the file that is explicitly selected by the user through the file selection dialog. 

 

Re: Performance Fluctuation in Java 6

Posted By:   alfredalfie  
Posted On:   Thursday, June 14, 2012 02:55 AM

The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License.  pedestrian accident lawyer

Re: Performance Fluctuation in Java 6

Posted By:   Hendrik_Gani  
Posted On:   Monday, November 9, 2009 06:40 AM

Sorry just realised that I had posted in the wrong forum. Please ignore this post.

I have re-posted in the "Other" forum instead. Please see: http://www.jguru.com/forums/view.jsp?EID=1521487
About | Sitemap | Contact