> ... and the Qemu not having enough (wrongfully assuming 128MB for the whole OS was enough).

Interesting that 128 MB was not enough. What did you do to find this issue and how are you measuring memory usage?

It was only doing problems when running things like Doom or videos, so I guess my rendering system isn’t optimized enough.

Double buffering a 4K 4bpp framebuffer itself is 64mb