Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java application wrapped runs faster on Windows 7 in Windows XP Compatibility mode

Java application runs faster on Windows 7 in Windows XP compatibility mode according to some of my customers, but why ?

I dont seem to have the problem myself, yet they find the application seems to be consuming 100% cpu whilst doing nothing, simply setting the properties of either the exe or a batch file that calls the java to Windows XP compatibility mode fixes it , how could that be ?

like image 212
Paul Taylor Avatar asked Aug 24 '12 09:08

Paul Taylor


People also ask

Can Windows 7 run in XP mode?

You can easily access any program or file in XP mode through a dedicated XP Mode Start Menu. When you hover over your Windows 7 Start button, a new button called "Windows XP Mode" will above it. Click there to access a full start menu from XP Mode right in Windows 7.

What does Windows 7 compatibility mode do?

Compatibility modeRuns the program using settings from an earlier version of Windows. Try this setting if you know the program is designed for (or worked with) a specific version of Windows.

How do I turn off Windows 7 compatibility mode?

Turn off compatibility modeRight-click the executable or shortcut file and select Properties in the pop-up menu. In the Properties window, click the Compatibility tab. Under the Compatibility mode section, uncheck the box for the Run this program in compatibility mode for option.


1 Answers

No definite answer but just a way to diagnose on site what is happening exactly.

You have to be confirm which process is consuming CPU and what it is doing exactly, for instance by monitoring system calls done: the sysinternals tools like Process Explorer and Process Monitor should lead to clues about what may be wrong. At least, you may compare execution profile with versus without XP compatibility mode.

As the problem may come from the Java application itself, you should give a try of a JVM profiling with tools like Netbeans Profiler. Maybe the code relies on some old Windows XP specific stuff like directory structure or environment variable that no longer exist or have changed in Windows 7 (but you kept/reapplied on your own installation)... leading to an improper error handling and infinite loop of retries for instance.

A native windows profiler may be an option too but it is far too difficult to analyze without JVM source code, and when Java code is concerned because of JIT.

like image 55
Yves Martin Avatar answered Nov 10 '22 00:11

Yves Martin