Sketch uses 121% of memory?

Hi there,
I was trying to upload to an attiny25v a sketch that I made when I got this error:

Sketch uses 2494 bytes (121%) of program storage space. Maximum is 2048 bytes.
Global variables use 144 bytes (112%) of dynamic memory, leaving -16 bytes for local variables. Maximum is 128 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.

But my sketch is quite small:

#include <SoftwareSerial.h>

int buttoncount = 0;

int buttonState = 0;

SoftwareSerial mySerial(4, 3);

void setup() {
  // put your setup code here, to run once:
  pinMode(0, INPUT);
  mySerial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:

  buttonState = digitalRead(0);

  if (buttonState == HIGH) {
    buttoncount = buttoncount + 1;
    delay(100);
  }

  if (mySerial.read() == "getcount") {
    mySerial.print(buttoncount);
  }

  if (mySerial.read() == "reset") {
    buttoncount = 0;
  }
}

Why is my sketch too big to upload?
Thanks!

The buffers allocated in Software Serial are probably too large.

  if (mySerial.read() == "getcount") {

The ONE character that SoftwareSerial::read() returns will NEVER equal the string "getcount".

PaulS: or more precisely, the address of the string "getcount".

ejj28: You need strcmp().

KeithRB:
PaulS: or more precisely, the address of the string "getcount".

ejj28: You need strcmp().

To compare a character to a string? Hardly a useful thing to do.

jremington:
The buffers allocated in Software Serial are probably too large.

OP also runs out of code memory :wink:

I am assuming that what they really want to do is build up a command string.