processing / processing/processing4

curveVertex() causes OutOfMemory in P2D renderer

未关闭
#832 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug core
主要语言
Java
星标
494
派生
183
平均合并
4 小时 39 分钟
30 天内合并 PR
3

描述

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?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用 P2D 渲染器运行提供的 Processing 4.3 sketch,比较 26,000 次和 2,000 次 curveVertex() 调用以及 Java2D 版本。跟踪 beginShape()、curveVertex() 和 endShape() 入口点在 P2D 渲染器中的调用路径。完成的标准是大型 sketch 不再耗尽 Java heap,同时保留预期的曲线输出。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
computer-graphics
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。