<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>731</bug_id>
          
          <creation_ts>2013-05-09 02:16:33 +0200</creation_ts>
          <short_desc>GLJPanel: Reduce JVM/CPU Heap Memory Usage - Share IntBuffer for readPixel/flip-vert</short_desc>
          <delta_ts>2013-05-09 04:50:09 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>awt</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>ff08ebae2f6ed8788d481f4a21fc7a07a75733ee
66e3917da774b723007811e66d95f37b1ffffc97
e6a234edb1318bb38f6ab65d96518471d0c7fd68
0a7bf77b8c0765f8a53dc72a8edab8e0496938ff
ed732cddbcb979062c56e9c93534a232aaa7fa20
890dabf77593732bd9833350b441a37c60f74d45</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2575</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-05-09 02:16:33 +0200</bug_when>
    <thetext>GLJPanel allocates one or two array backed IntBuffer for each instance.

- 1: BuffereImage
- 1: Vertical Flipping if GLSL flipping is n/a

Extensive use leads to to out of memory errors on the CPU/JVM side.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2576</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-05-09 02:21:34 +0200</bug_when>
    <thetext>Solved by attempting to use a singleton pixel buffer.

Impl. now reuses generalized GLPixelBuffer* -&gt; SingleAWTGLPixelBufferProvider,
incl. row-length-stride where available (GL2GL3).

Further beneficial is the generalized [AWT]GLPixelBuffer* refactored util class,
allowing users to inject a pixel-buffer provider into a toolchain, here:
  - GLJPanel
  - GLReadBufferUtil

New test case: TestGearsES2GLJPanelsAWT
  
GLJPanel SingleAWTGLPixelBufferProvider&apos;s screenshots:
     &lt;http://jogamp.org/files/screenshots/gljpanels-singlebuffer/&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2578</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-05-09 02:53:50 +0200</bug_when>
    <thetext>GLJPanel still uses an individual GLPixelBuffer instance.
If using SingleAWTGLPixelBufferProvider, the following creation sequence may happen:
  1- 200x200 *new*
  2- 400x400 *new*
  3- 200x200 *reuse*

the smaller prev. GLPixelBuffer are still in use, even though they could be dropped
in favor of the current biggest GLPixelBuffer.

Hence we have to validate, whether we can make the field static:
  AWTGLPixelBuffer pixelBuffer

this would allow us to get rid of the prev. smaller allocations and save resources.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2579</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-05-09 04:50:09 +0200</bug_when>
    <thetext>fixed, see 890dabf77593732bd9833350b441a37c60f74d45</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>