Displaying 1 result from an estimated 1 matches for "do_something_with_file".
2007 Dec 19
0
memory management in long running scripts
...and seems to use up a large
chunk of memory, building up fairly quickly, but then never really
going above 55% of the system memory. This is the basic structure of
my script:
loop do
Find.find(path) do |name|
if FileTest.directory? name
Find.prune unless name.eql? path
else
do_something_with_file
end
end
sleep(0.05)
end
Even when my do_something_with_file function is modified to simply
return right away, the memory usage of the script continues to
increase. Is there any issue with reading directories as I am above?
Or is there a way to cap the amount of memory a script uses, or a...