JDK-8101075 : Reduce prism-es2 memory footprint
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2011-12-13
  • Updated: 2015-06-16
  • Resolved: 2012-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u6Resolved
Related Reports
Blocks :  
Duplicate :  
Description
The memory footprint question was brought up in this morning meeting. So here is a short analysis I have put together to help us better understand what we have achieved and what can be improved on the prism-es2 pipe in term of memory footprint reduction.

Here is the breakdown of prism-es2 related native libraries and jars (note that prism-util.jar is also used by prism-d3d)

Current in my workspace:
-rw-r--r--  1 cyang  staff  407152 Dec 13 13:06 artifacts/sdk/build/lib/desktop/libprism-es2.jnilib
-rw-r--r--  1 cyang  staff   38135 Dec 13 13:06 artifacts/sdk/build/lib/desktop/prism-es2-mac.jar
-rw-r--r--  1 cyang  staff  274694 Dec 13 13:06 artifacts/sdk/build/lib/desktop/prism-es2.jar
-rw-r--r--  1 cyang  staff   55166 Dec 13 13:06 artifacts/sdk/build/lib/desktop/prism-util.jar

55166 + 407152 + 38135 + 274694
=775147 bytes (uncompressed)

jfx-202:
-rw-r--r--  1 cyang  staff  493928 Nov 10 08:50 202/jfx/artifacts/sdk/build/lib/desktop/libprism_jogl_gl2.jnilib
-rw-r--r--  1 cyang  staff   24800 Nov 10 08:50 202/jfx/artifacts/sdk/build/lib/desktop/libprism_nativewindow_jvm.jnilib
-rw-r--r--  1 cyang  staff   29688 Nov 10 08:50 202/jfx/artifacts/sdk/build/lib/desktop/libprism_nativewindow_util.jnilib
-rw-r--r--  1 cyang  staff  143151 Nov 10 08:55 202/jfx/artifacts/sdk/build/lib/desktop/prism-es2.jar
-rw-r--r--  1 cyang  staff  278994 Nov 10 08:50 202/jfx/artifacts/sdk/build/lib/desktop/prism-jogl-common.jar
-rw-r--r--  1 cyang  staff  123792 Nov 10 08:50 202/jfx/artifacts/sdk/build/lib/desktop/prism-jogl-glu.jar
-rw-r--r--  1 cyang  staff   40836 Nov 10 08:52 202/jfx/artifacts/sdk/build/lib/desktop/decora-ogl.jar

143151 + 278994 + 123792 + 493928 + 24800 + 29688 + 40836
=1135189 bytes (uncompressed)

Percentage reduction: ~ 32%
Reduced # of native libraries: 2
Reduced # of packages: 1

There is still room where we can further reduce the memory footprint by possibly 50% simply by trimming away unused GL binding methods  (in Java and in native). This is a relative safe work which is best to wait till we have a functional X11 port. 

Listing of the top 5 largest files in prism-es2 projects:

prism-es2
     525 ./GLCapabilities.java
     880 ./GL.java
    1076 ./GL2GL3.java
    2669 ./GL2.java
    6323 ./impl/gl2/GL2Impl.java
   18226 total

prism-es2-mac
     248 ./src/com/sun/prism/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
     274 ./src/com/sun/prism/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
     324 ./src/com/sun/prism/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
     335 ./src/com/sun/prism/opengl/impl/macosx/cgl/MacOSXCGLContext.java
     539 ./src/com/sun/prism/opengl/impl/macosx/cgl/CGL.java
    2679 total

prism-es2-native
     792 ./src/macosx/CGL_JNI.c
    1269 ./src/x11/GLX_JNI.c
    1585 ./src/windows/WGLExtImpl_JNI.c
    1661 ./src/x11/GLXExtImpl_JNI.c
    8174 ./src/GL2Impl_JNI.c
   15458 total
Comments
This issue is a duplicate of RT-19034
14-05-2012

This issue should be resolved by fixing RT-19034
06-03-2012

Consider as a possible optimization for 2.1. Given that we plan to retire the bindings in 2.2 this may not be worth the effort.
14-12-2011