Static vs dynamically allocated object

I ran into a big problem with a program I'm writing. I didn't realize how little RAM memory is on the Arduino Uno, so even though my program is only about 16k (out of the 32k on the Arduino), as it was allocating the objects it apparently ran out of RAM memory (of which there is only about 2k) and it started doing all sorts of weird behaviors, a lot of which looked like it was corrupting the stack.

So I rewrote a ton of the code so that the objects are simply declared rather than dynamically created. That is, instead of doing something like:

MyObjectClass* pMyDynamicallyAllocatedObject = new MyObjectCLass();

I'm doing this:

MyObjectClass MyStaticallyAloocatedObject;

And it compiles just fine. But now when I run it NOTHING HAPPENS. Nothing at all. The program does lots of NeoPixel manipulation. Before I hit that RAM wall it was running quite well, lighting up pixels properly. But since I re-wrote it all to do mostly statically allocated objects, it just sits there and does nothing.

I'm assuming that statically declared objects end up in the EEPROM (the 32k section) and not in RAM. Is that right?

HELP!!!!

Without seeing your program how can we help ?

RogerInHawaii: That is, instead of doing something like: MyObjectClass* pMyDynamicallyAllocatedObject = new MyObjectCLass();

Placed on the heap.

I'm doing this: MyObjectClass MyStaticallyAloocatedObject;

Placed in initialized data.

The heap is a section of SRAM. Initialized data is a different section of SRAM. You moved your object from one section to another but it is still in SRAM.

I'm assuming that statically declared objects end up in the EEPROM (the 32k section) and not in RAM. Is that right?

No. The only things that end up in EEPROM are things that you explicitly place there. In any case, instances of MyObjectClass cannot be placed there.

I'm assuming that statically declared objects end up in the EEPROM (the 32k section) and not in RAM. Is that right?

In general, no.