Data section exceeds available space in board

I'm making a small game recently and I want to use Arduino to do it. My code compiles without problems, but when I upload it, I get an error like the one shown in the picture, is it because I have too many variables defined?
Can someone please tell me how to fix it?

I cannot read the error text. However if you just compile and not load the program (use the check mark in the upper left of the IDE). The compiler will tell you how much of each type of memory is allocated.

Are you sure you are loading to the same board you compiled the code for?

Pictures of text are rarely useful. The IDE has a "copy error message" button to allow you to copy and paste. You also need to say what board you are compiling for and possibly post your sketch (using code tags as outlines in the sticky post at the top of the forum)

@vincomgo, your topic has been moved to a more suitable location on the forum.

Please take some time to read How to get the best out of this forum (again?).

Next post full code and error messages using the code tags as described in the link above.

Thanks for the reminder, is this how I need to put it up?

Arduino:1.8.12 (Windows 10), Development board: "Arduino Uno"

The project uses 6336 bytes, which occupies (19%) of the program storage space. The maximum is 32256 bytes. data section exceeds available space in board

Global variables used 3046 bytes, (148%) of dynamic memory, leaving -998 bytes for local variables. The maximum is 2048 bytes.
There is not enough memory; visit the following URL to follow the instructions to reduce memory usage.
Error while compiling for development board Arduino Uno.

Turn on in File -> Preferences
"Show detailed output during compilation" option
This report will contain more information.

It seems that there is not enough RAM.

He doesn't write the full code so I'll write my prediction.

Are you printing a lot of character strings with Serial?

Serial.println("EAT RAMRAMRAM...");

They occupation RAM by default.

If you are passing a fixed string, you can fix it by using the F macro.

Serial.println(F("NEVER EAT!"));

Thank you, I will try it!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.