Hi,
Thanks for the confirmation and suggestion.
I had tried Database, it do not work well for me, since the database need more
data structure to maintain the data, it take longer time or more memory to add
or remove data and matain the index table. In some case the pure TEXT file or
array is much efficient, such as sorting.
It is nice there is a place we can discuss these issus.
Org.
> Date: Wed, 10 Dec 2008 02:59:47 +0000> From: [EMAIL PROTECTED]> To:
> beginners@perl.org> CC: [EMAIL PROTECTED]> Subject: Re: how to release memory
> from a hash table or array> > org chen wrote:> > > > I read a large file into
> a hash table. This hash table is used only once in> > the subroutine. I am
> very concern the memory usage, So I plan to realse the> > memory after used
> the hash table. The way I used is:> > > > my %hash = ();> > > > #read the
> large file into the hash table> > ...> > > > #release memory> > %hash = ();>
> > > > Do you think this way will really release memory usage?> > > > By the
> way, I found the hash table use much more memory than the array. I > > think
> hash table and array use different data structrue. it need much more > >
> memory to matain the hash tabe structure. I hope what I find is useful.> >
> Yes, that will flag all of the memory used by the hash for release.> > But
> there must be a way to rewrite the subroutine so that it doesn't copy the>
> entire file into memory and then release it. Also, if your file is really so
> big> and requires frequent access then you should think about creating a
> database.> > Please show us your subroutine and describe the contents of the
> file so that we> can help you further.> > Rob
_________________________________________________________________
Holiday cheer from Messenger. Download free emoticons today!
http://livelife.ninemsn.com.au/article.aspx?id=669758