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 & HelpPrograms › What is the largest graphic screen in proce55ing
Page Index Toggle Pages: 1
What is the largest graphic screen in proce55ing? (Read 679 times)
What is the largest graphic screen in proce55ing?
Mar 20th, 2008, 5:24pm
 
I'm trying to get an off screen blitting canvas that's roughly twice the size of the drawing window, and i just keep getting the not enough heap space problem. So what is the general size most user's computers can tolerate if this applet is on the net?
Re: What is the largest graphic screen in proce55i
Reply #1 - Mar 24th, 2008, 3:29am
 
i've changed the question slightly, since it doesn't seem to elicit a response.

Creating a really large pgraphic using the creategraphics call to get a separate rendering context can lead to a out of heap space error, what is a good ball park figure for heap space usage on the internet?

Re: What is the largest graphic screen in proce55i
Reply #2 - Mar 24th, 2008, 6:41am
 
Have you tried increasing the "Set maximum available memory" setting in preferences?

I really don't know what would be a reasonable size for the internet, but if it throws this error in your machine (which I assume is not a 386 with 4MB of RAM) maybe you should try another way to solve the problem.

Or maybe I'm just not understaing the question correctly.
Re: What is the largest graphic screen in proce55i
Reply #3 - Mar 24th, 2008, 10:26am
 
no no, you understood it right. But was just wondering what the consensus was on the average size out there, and i don't think setting the preference on the pde would mean an exported applet is going to do that to the remote machine. i think that's possible only using java web start. someone stop me if i'm wrong.
Re: What is the largest graphic screen in proce55i
Reply #4 - Mar 24th, 2008, 2:39pm
 
I think if you're getting an error, wit the defaults, anyone out there viewing it online will et an error, so setting your memory higher won't help at all.

I don't know if it's possible to increase the available memory for an online applet.
Re: What is the largest graphic screen in proce55i
Reply #5 - Mar 24th, 2008, 7:47pm
 
Yeah. You two are probably correct. It doesn't make sense to change YOUR JVM memory limits cause that won't change the target's machine memory limits.

Then what I don't get is, what exactly are you doing to be needing so much memory?

Are you sure there are no leaks, or ill-formed loops or other bottlenecks? Maybe there's some error that's making your program ask for more RAM than it's actually needed?

BTW, "blitting"? What does that mean?
Re: What is the largest graphic screen in proce55i
Reply #6 - Mar 25th, 2008, 2:50am
 
Yeah, but i think it's actually dependent on the remote machine's installed memory in the first place, unless the browser itself sets a limit, which is why i'm wondering what's  a good ball park figure.

A blit is when you copy an offscreen image into the current viewing area. In the past, you'd write the pixels into a memory space, and then just copy that across into the memory space of the video card that will be displayed on screen. Now, everything's basically abstracted away from that.

There aren't any ill formed loops or whatever, since the program simply just dies during initialization.

Re: What is the largest graphic screen in proce55i
Reply #7 - Mar 25th, 2008, 7:05am
 
So you are basically trying to do a double buffering technique?

It shouldn't be hogging your memory.

Right now I'm working on a project that loads about 16 images, all 1024x768 PNGs and it won't run out of memory as long as I set the limit to 1024 MB. I haven't really tried setting it to the lowest working value, but I think most machines now have at least 512.

Are you absolutely sure there are no memory leaks or something that keeps asking for RAM even when it's not needed?

My logic tells me that if you wokr with say, 2 images (one on screen and one off screen) at say, a resolution of 1280x960 that would consume less memory than 16x1024x768.

So, I can't really imagine what could be wrong except memory leaks.

Maybe you could post the offending piece of code?
Re: What is the largest graphic screen in proce55i
Reply #8 - Mar 25th, 2008, 7:54am
 
Code:

PImage a;
PGraphics pg;
PGraphics pg2;
void setup() {
size(1200,800,P3D);
int w=width*2;
int h=height*2;
a=loadImage("/data/fullsite.gif");
pg=createGraphics(w,h,P3D);
pg2=createGraphics(w,h,P3D);
}
void draw(){
}


Hehe ... this snippet did the trick on my computer.

Re: What is the largest graphic screen in proce55i
Reply #9 - Mar 25th, 2008, 9:21am
 
You do know that processing is already double-buffered right? So there's no need to do it, if that's all you're trying to achieve.
Re: What is the largest graphic screen in proce55i
Reply #10 - Mar 25th, 2008, 9:42am
 
Ah no i'm not doing it just to double buffer. The problem i have is that i want the after images of an image() call, and rotating the camera doesn't rotate that at all, hence the use of another rendering context.

Page Index Toggle Pages: 1