Next Previous Contents

4. Memory usage

  1. In "binary" data transfer mode (TYPE IMAGE and TYPE LOCAL 8) the server maps the file to be sent with mmap in big chunks (approximately 10 Mbytes) and passes the addresses of these chunks to TCP/IP Protocol. It is the headache of the transport protocol how to transfer the data efficient.
  2. In "ASCII" data transfer mode (TYPE ASCII) server maps the file to be sent with mmap. For each chunk of the file it appends each line to the buffer of fixed size. Once this buffer is filled the program sends its content to peer. The size of the buffer is 128K. The same technique is used for output of LIST and STAT path commands.
  3. Responses to peer are also collected in a buffer of fixed size. They are sent each time the buffer is full or the program explicitly tells to do so.
  4. The program uses expandable buffers for collecting strings of virtually any length.


Next Previous Contents
Hosted by uCoz