Is the problem in the code or in the OLED screen?

Most OLED drivers allocate a (relatively) huge screen buffer at run time. That is not reported at compile time because it's dynamically allocated.