Skip to content

curveVertex() causes OutOfMemory in P2D renderer #832

Open
@processing-bot

Description

@processing-bot

Created by: Real-John-Cheung

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcore

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions