From: Florian Gross Date: 2007-07-17T10:34:34+09:00 Subject: Re: How to reclaim memory without GC.start On Jul 16, 11:30 pm, "dtutt...@gmail.com" wrote: > file = File.new file_path > while buffer = file.read(512) > stream_host_connection.write buffer > stream_host_connection.flush > # GC.start - too expensive > end Note that IO#read supports a buffer argument: buffer = "" while file.read(512, buffer) ... end In that case it won't create a new string object for each call. It will just modify buffer instead.