In the first example the canvas uses P2D (OpenGL) and in the second case it uses JAVA2D (Java AWT). I don’t know if this is the cause but it is the only significant difference that I can see.
Interestingly some years ago I had a P3D project that needed thousands of frame buffers and there was a memory leak after a while. I couldn’t solve the issue and I had to port some part of the code to openFrameworks and then I didn’t see the issue.
But @TellAJoke is there a reason why you need to create image and buffer every draw frame? Can’t you initialize it in setup and reuse it?
Sorry for the late reply.
I’m showcasing a series of different shaders at once. The shaders change over time too, so I’m creating new images every frame.