Variables are not stored in program memory (flash), they are stored in RAM, and the mega168 only has 1k of RAM. You realistically only have room for an array of maybe 200 to 300 2-byte integers since the Arduino serial library uses 128 bytes for its receive buffer and the mega168 uses stores its stack in RAM. If your array is constant you can store it in program space (which is 14k) by including <avr/pgmspace.h> and using the PROGMEM attribute in your array declaration, but it looks like in your case this wouldn't help you.

If you need to store a large array, maybe you should look into purchasing an external RAM module.

Variables are not stored in program memory (flash), they are stored in RAM, and the mega168 only has 1k of RAM.[...] If your array is constant you can store it in program space (which is 14k) by including <avr/pgmspace.h> and using the PROGMEM attribute in your array declaration, but it looks like in your case this wouldn't help you.

If you need to store a large array, maybe you should look into purchasing an external RAM module.

Thanks for the info!It's good to know that pgmspace.h exists.Where can I find a RAM module? Is it fast as interna RAM?

It looks like you are using the array to store readings from a sensor at 1ms intervals so something like this 24LC64 EEPROM http://www.futurlec.com/Memory/24LC64.shtml may be suitable. It should be more than fast enough for your two bytes per ms data rate, will hold the readings even with power off, uses just two (I2C) pins for interface and costs a dollar or two an 8k byte part.

you can find an example sketch interfacing with i2c memory here : http://www.arduino.cc/playground/Code/I2CEEPROM