Memory leak?

B

Bil Kleb

Hi,

Does anyone see anything here,

for case_number in 1..NUMBER_OF_CASES
case_dir = File.join( 'Cases', 'Case' ) + case_number.to_s.rjust(5,"0")
mkdir_p case_dir
ln_sf LINK_FILES, case_dir unless LINK_FILES.empty?
cp COPY_FILES, case_dir unless COPY_FILES.empty?
cd case_dir do
fuzzy_contents.each do |original_name, fuzzy_content|
File.open(original_name,'w'){ |f| f.puts fuzzy_content.sample }
end
end
$stdout.print '.'; $stdout.flush
end

that should cause a steady growth in memory?

It works fine for 5,000 cases; but by about 10,000 cases,
the process exceeds 2GB!

Thanks,
 
B

Bil Kleb

Bil said:
Does anyone see anything here,

[..]

that should cause a steady growth in memory?

It works fine for 5,000 cases; but by about 10,000 cases,
the process exceeds 2GB!

Doh! Nevermind, fuzzy_content.sample contains an array push:

(@fields[tag] ||= []) << sample

I guess it is time to look at persisting to the file system
instead of storing everything in memory...

Later,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,052
Latest member
EvaW192252

Latest Threads

Top