Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curveVertex() causes OutOfMemory in P2D renderer #832

Open
Real-John-Cheung opened this issue Apr 12, 2024 · 0 comments
Open

curveVertex() causes OutOfMemory in P2D renderer #832

Real-John-Cheung opened this issue Apr 12, 2024 · 0 comments

Comments

@Real-John-Cheung
Copy link

Description

curveVertex() causes java.lang.OutOfMemoryError: Java heap space error when the vertex amount is big in P2D render. With the default Java2D render it works fine.

void setup(){
  size(800,800, P2D);
  beginShape();
  for(int i = 0; i < 26000;i ++){ 
    curveVertex(i * 0.1, 100);
  }
  endShape();
}

Above sketch crashes due to OutOfMemoryError, below sketches can be executed without problem:

void setup(){
  size(800,800);
  beginShape();
  for(int i = 0; i < 26000;i ++){ 
    curveVertex(i * 0.1, 100);
  }
  endShape();
}
void setup(){
  size(800,800, P2D);
  beginShape();
  for(int i = 0; i < 2000;i ++){ 
    curveVertex(i * 0.1, 100);
  }
  endShape();
}

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: macOS 14.4.1
  • Other information: on a Intel Mac

Possible Causes / Solutions

Might have something to do with how Catmull-Rom splines is calculated in P2D?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant