On Tue, 15 Jan 2002, Matt Armstrong wrote:

> ptkwt / shell1.aracnet.com (Phil Tomson) writes:
>
> > In article <CEENJIKJHPPGICBNAFMICEJKDEAA.mchahn / facelink.com>,
> > Mark Hahn <mchahn / facelink.com> wrote:
> >>
> >>> you should consider using a database
> >>
> >>Doing 200 million lookups in a db would take way too long for my
> >>script.  If there is no other work-around than using a DB, then I'll
> >>have to go back to Java, which can handle this kind of memory usage.
> >>I'm dissapointed that in one of the first quick scripts I went to
> >>Ruby for, Ruby couldn't do the job.
> >
> > How does java acheive this feat?
> > (or how do you do it in java?)
>
> 4 million 16 character strings is only 64 megs.

They're not wide characters in java?

So you're saying that Ruby strings take up more space? (probably, since
doesn't ruby use wide chars?)

What do these 16 character strings represent?

> Even if the overhead
> of a String object itself and the entry in the hash table is 4 times
> that, you're still only at about 300 megs.  On a machine with 4 gigs
> of RAM, that should be possible.

Yes, but I think that's a lot more available RAM than you mentioned in
your original post.  From what you said earlier if you 4gigs of RAM then
the Ruby version should work without any problem (am I missing something?)

Phil