Ethernet lib: hang after many client.print

hi,
i am writing a project of sending the thml code in sdcard to server.
at the begining every thing is woring good. but when the data become bigger and bigger, then ethernet hang,
it always hang at the same place. any person face the same problem also??
my code is something like this...
thank you

void sd_sendtable(EthernetClient & client,char filename[32], String token)
{
  Serial.println(filename);
   SdFile file2;
   if (!file2.open(filename, O_READ)) restart();
    int16_t data; 
    int countContent = 0;
    boolean stopsend = false;
    BUFFER sendContent; 
    memset(sendContent, 0, STRING_BUFFER_SIZE);
    while ((data = file2.read()) >= 0 || stopsend == false){     
      if(data <= 0){
        stopsend = true;
      }
      else{
        //250 token
        if(data == 250){
          sendContent[countContent] = token[0];
          sendContent[countContent + 1] = token[1];
          sendContent[countContent + 2] = token[2];
          sendContent[countContent + 3] = token[3];
          sendContent[countContent + 4] = token[4];
          sendContent[countContent + 5] = token[5];
          countContent = countContent + 6;
        }
        else if(data == 220 || data == 221 || data == 222 || data == 223 || data == 224){
          // remove the symbol
        }      
        else
        {
          sendContent[countContent] = data;
          countContent = countContent++;
        }
      }
      if(countContent == STRING_BUFFER_SIZE - 20 || stopsend == true){
        client.print(sendContent);
        memset(sendContent, 0, STRING_BUFFER_SIZE);
        countContent = 0;
      }
    } 
    // close the file:
    file2.close();
}

Post your entire sketch. That code snippet means nothing.

my entire sketch is very long and in difference file.

i am using arduino mega.
i just found out that the more code i write the less client it can print.
is that because of run out of ram?
i place the freememory() at the end of the client print loop, ir show the ram still have about 2000.
any idea about that???

Don't use the String data type. That is all I can tell from your code snippet.

but when the data become bigger and bigger, then ethernet hang,

then

is that because of run out of ram?

Hmmm...