diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-04 18:53:14 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-08 19:01:14 -0700 |
commit | 6c8f2db31097998aaab21c05cab53b50bfc243c5 (patch) | |
tree | af398bb7f05a9c75c43eb763c56c1be723037609 | |
parent | 673861cd6fcb8f563de9c6300252d5ff290adee1 (diff) | |
download | mogilefs-client-6c8f2db31097998aaab21c05cab53b50bfc243c5.tar.gz |
Yes, I'm quite miserly when it comes to memory usage. Since the file is already on disk, just read it incrementally and stream it out to avoid having to deal with potential memory exhaustion issues on busy systems. There's also no benefit to slurping 256MB and anything above 64K leads to diminishing returns on most systems I've seen.
-rw-r--r-- | lib/mogilefs/mogilefs.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb index b1fe57d..aac7e3d 100644 --- a/lib/mogilefs/mogilefs.rb +++ b/lib/mogilefs/mogilefs.rb @@ -172,7 +172,7 @@ class MogileFS::MogileFS < MogileFS::Client if file.respond_to? :sysread then return sysrwloop(file, mfp) else - if File.size(file) > (256 * 1024 * 1024) # Bigass file, handle differently + if File.size(file) > 0x10000 # Bigass file, handle differently mfp.bigfile = file return mfp.close else |