Pages: [1]   Go Down
Author Topic: Running out of memory?  (Read 315 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 119
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What happens when you try to use more memory than the Arduino has?  Does the compiler error?  Does your code just do weird things, etc?

Also, how much does it have?  i've read 1k in various places, is that right?
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6645
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The micros used in the Arduino have 1K of "ram", usable for changing data.  That's partially used by things like "the stack."  I don't see any warnings from the compiler if I deliberately exceed the memory with something like:
Code:
unsigned long bigdata[300];
Some of the things that would traditionally be stored in "ram" can be stored in EEPROM (512 bytes) or the flash instead (there is 14k of flash) using the PROGMEM directive, but it becomes annoying to access...
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 119
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm... i havent run into any problems yet, but i could definitely see the potential for it, especially since i'm trying a full-on object oriented approach as well as doing something rather complicated (3 axis controller w/ limit switches + serial comms)
Logged

Pages: [1]   Go Up
Jump to: