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

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to