[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Memory leak?

Bil Kleb

12/16/2007 5:10:00 PM

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,
--
Bil Kleb
http://fun3d.lar...
3 Answers

Bil Kleb

12/16/2007 5:14:00 PM

0

Bil Kleb wrote:
> 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,
--
Bil Kleb
http://nasarb.rub...

yansimon52

11/18/2013 6:07:00 PM

0

Halo...iman fisjono....lazy bum?
We are talking something deeper than lazy bum.and how tis story book can destroy.society.

Take for example...as usual ..a young teen under d mother care...n before he read that story book...when you accidently step on this young boy"s foot...before u say "sorry"...tis young teen may even say sorry to u before u said sorry.
Once tis young teen read thru tat story book...just overnight....next day when u again accidently step on his foot....this time he will ask u tis....why u step on my foot? After
that tis young teen will "tip for tap"..maturing him into of having kind of smart alec..
So.u tell me how to govern a muslim demominated soceity when there are so many smart alec around....

The Philosopher

11/18/2013 6:53:00 PM

0

On Mon, 18 Nov 2013 10:07:22 -0800 (PST), yansimon52
<yansimon52@hotmail.com> wrote:

>Halo...iman fisjono....lazy bum?
>We are talking something deeper than lazy bum.and how tis story book can destroy.society.
>
>Take for example...as usual ..a young teen under d mother care...n before he read that story book...when you accidently step on this young boy"s
>foot...before u say "sorry"...tis young teen may even say sorry to u before u said sorry.

What's wrong with that?

>Once tis young teen read thru tat story book...just overnight....next day when u again accidently step on his foot....this time he will ask u tis....
>why u step on my foot?

How do you know that he will say something like that?

>After
>that tis young teen will "tip for tap"..maturing him into of having kind of smart alec..

Do you think all kids are like you? ROTFL

>So.u tell me how to govern a muslim demominated soceity when there are so many smart alec around....

There are good Muslims, and there are rotten Muslims, just like there
good Atheist, and rotten Atheist who has no shame and no guilt...