J2SE 2D Performance Flags

I just got off a 6am con-call with a customer having some problems with Java 2D/Swing performance on multiple monitor systems. Unfortunately we don't have any sort of test case so we're shooting slightly in the dark for now. A quick search for Java 2D optimization and runtime flags brings up some interesting stuff.

From the 1.4.2 Release Notes:

One example of a known problem is that using Direct3D on some small subset of Windows 2000 systems has been known to cause a system crash. You can also try launching your application with the following command-line flag set:

-Dsun.java2d.d3d=false
This forcibly disables our use of Direct3D and avoids any Direct3D-specific problems.
You can also try the following flag:

-Dsun.java2d.ddoffscreen=false
This flag disables our use of DirectDraw and Direct3D for offscreen images (such as the Swing back buffer).
If problems persists, try launching the application with this flag:

-Dsun.java2d.noddraw=true
This flag disables our use of DirectDraw and Direct3D completely and thus avoids any problems you may be seeing associated with our use of those APIs and their respective drivers on your system.
For more information about performance-related flags, see Flags for Controlling Performance and Quality, a section in the High Performance Graphics white paper (also available in PDF format).

\* Drawing many simple primitives to an accelerated offscreen surface may result in a JRE crash and corruption of the underlying graphics subsystem due to leakage of GDI resources. This problem is being tracked as bug 4766813. The workaround is to turn off offscreen acceleration:
-Dsun.java2d.ddoffscreen=false


And from the Graphics Performance Improvements white paper:

# -Dsun.java2d.noddraw=true
Setting this flag to true turns off DirectDraw usage, which sometimes helps to get rid of a lot of rendering problems on Win32.

# -Dsun.java2d.ddoffscreen=false
Setting this flag to false turns off DirectDraw offscreen surfaces acceleration by forcing all createVolatileImage calls to become createImage calls, and disables hidden acceleration performed on surfaces created with createImage.

# -Dsun.java2d.ddscale=true
Setting this flag to true enables hardware-accelerated scaling. Hardware scaling is disabled by default to avoid rendering artifacts in existing applications. These rendering artifacts are caused by possible inconsistencies between the scale method that the software scaling operation uses (nearest neighbor) and the different scale methods that video cards use. Certain events that occur while an application is running might cause a scaled image to be rendered partially with hardware scaling operations and partially with software scaling operations, resulting in an inconsistent appearance. For now, you can enable acceleration by setting the ddscale flag to true.
Comments:

Post a Comment:
Comments are closed for this entry.
About

moazam

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today