Problems using SD.h and Wire.h with Arrays. Possible SRAM issue?

Greetings,

I have been working on a fairly intensive project using an Arduino UNO as a data logger. Everything was going great until I needed to add a few Arrays into my code. The added Arrays would make my code do all sorts of funny things, e.g. return funny results or lock up the microcontorller. Here is the simplest code I cold build that would reproduce the problem.

#include <Wire.h>
//#include <SPI.h>
#include <SD.h>
#include <MemoryFree.h>

void setup() {
  
  Serial.begin(9600);

      Serial.print("freeMemory()=");
    Serial.println(freeMemory());
  
  Serial.println("hello world");

  float data[250];

  int i;
  for (i = 0; i < 250; i = i + 1) {
    data[i] = i;
  }


  for (i = 0; i < 250; i = i + 1) {
    Serial.println(data[i]);
  }
}


void loop() {
}

The problem is only present when both the Wire.h and SD.h libraries are uncommitted. I did some reading and I think this may be a memory problem. I was able to check this with the Memoryfree.h library. here are my results

No libraries active; freeMemory()=796
Wire.h active; freeMemory()=589
SD.h active; freeMemory()=184

I am starting to think this is an SRAM issue, :confused: .

Here are the questions I have

Is there a "simple" way to fix this?

I am using Wire.h and SD.h successfully without arrays, in my code and projects. Will the lack of memory cause hurt my UNO's on my working boards?

Would adding an external ram, as shown in the link below be a possible fix to this problem?
http://playground.arduino.cc/Main/SpiRAM

Thanks in advance for any help.

An update and some more background.

I am needing to log a fair about of data as quickly as possible. Currently I am writing my data to a SD card in the loop, but each write takes 20 ms, this is really to slow.

My firsts idea was to write the data into an array, and then write the array to the SD card after a few hundred data points. This is not working due the the above mentioned problems.

My second idea was to write the data to a eeprom I had sitting around, a 24LC256. This works, but is no faster than writing to a SD card. Unless I can add more SRAM to the Arduino, my next idea is to write the data to an external SRAM chip.

Ill keep trying.

This response is to help others who have this issue.

The problem with multiple libraries is that Uno has only a limited amount of SRAM. There is really no workaround.

A