loadShape freezes Raspberry Pi

I just found out calling loadShape function caused my raspberry pi to freeze. Sometimes, it threw an error on Java heap memory space. The obj file is in the same directory as the pde file. I had no issue with Windows.

I’m using

  • Raspberry Pi 3+ and 7" monitor.
  • Processing 4.3

The code is

PShape milkjug;

public void setup() {
  size(400, 400, P3D);
  milkjug = loadShape("milkjug.obj");

public void draw() {

I performed a similar test with a LattePanda Delta 3 running Windows 10 64-bit. I thought the CPU type might be the issue but I had the same error. I tested this on a 7" monitor (1024x600) and a 24" monitor (HDMI interface on both).

I used Processing 4.3.

The error message is shown below. When I closed the processing window, another window popped up with an error message “OpenJDK Platform Binary is not responding.”

I could get LattePanda working after increasing the max memory to 3 GB. (Preferences > Running > Increase max available memory to 3000 MB). The LattePanda has 4 GB RAM.

Unfortunately, it did not work with the Raspberry Pi. It has 1 GB RAM and I set the max available memory to 900 MB. I even tried 1000 MB.

Note: The obj file is only 5.5 MB.

According to the Task Manager (Windows 10), Processing opened 2 windows: the sketch window was taking up 500 MB RAM and the other (for running the sketch) 1.9 GB RAM. So, it made sense that Raspberry Pi 3B+ did not work.

It’s safe to conclude that the issue was lack of RAM. I don’t have Raspberry Pi 4 with at least 4GB. I can confirm this once I have tested it. For now, I’ll stick with the LattePanda.