We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › GLGraphics memory issue
Pages: 1 2 
GLGraphics memory issue (Read 2842 times)
Re: GLGraphics memory issue
Reply #15 - Feb 16th, 2010, 10:46am
 
Update and partial solutions, briefly but happily.

As recommended I re-arranged the code so that textures would be created only once in the setup, and then updated by the loop. It made a true difference, I thought creation of textures with the same variable name would wipe and replace the texture, definetly not (or I don't know how to do that). But it still leaked and was not proper for the installation. Tried billions of funny things and found System.gc() called regularly, it made the situation better. But still...

Then I run my test application on a smaller computer with a Nvidia graphic cards... and the memory ressource graph raises and then stay flated... oO

Here is the test code I used on the two computers
Code:
import codeanticode.glgraphics.*;
import processing.opengl.*;

float count;
PImage img;
GLTexture tex;

void setup() {
 size(1280,720,GLConstants.GLGRAPHICS);
 count = 0;
 tex = new GLTexture(this,1280,720,JPEG);
}

void draw() {

 if(count==0) {
   img = loadImage("img.jpg");
 }

 tex.putImage(img,JPEG);
 image(tex,0,0,width,height);
 count++;

 if(count==20) {
   System.gc();
   background(0);
   count=0;
 }

}


I can't believe it is driver/hardware issue... But I managed to run my photomaton application on this nvidia powered laptop with no outragous memory consumption or leakage, so I might try to borrow one of these for the project's machine.

@ ac : the library update did not make noticeable improvements from what I could see. But I went thru the doc and there are many good things cooking in there.

So this (in my opinion) is not a real solution to my original problem, and I WILL go deeper in GL manipulation to get better at it. And try to gather infos concerning the possible differences between those two manufacturers.

dF
Pages: 1 2