List Info

Thread: memory collection




memory collection
country flaguser name
United States
2007-08-20 19:03:56

Hi,

I have five subroutines in a script.

However, if I call them one by one in order, I have
memory problem. Instead, I call the first subroutine
then exit the script. Next, I run the script only
calling the 2nd subroutine and so on. It works fine.

As you know, I have to run the script five times in
order for all the subroutines to be done.

My question, how can I run the five subroutines one by
one at once? how do I claim the memory allocated to
each subroutine?

__________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

__._,_.___
.

__,_._,___
Re: memory collection
country flaguser name
United States
2007-08-20 19:41:57

>>&gt;>> "jiqiang" == jiqiang yao < jiqiang123%40yahoo.com">jiqiang123yahoo.com> writes:

jiqiang&gt; However, if I call them one by one in order, I have
jiqiang> memory problem. Instead, I call the first subroutine
jiqiang&gt; then exit the script. Next, I run the script only
jiqiang> calling the 2nd subroutine and so on. It works fine.

Sounds like you're using package (global) variables and not cleaning them up.
Are you using "my&quot; (lexical) variables defined within each subroutine only?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<; merlyn%40stonehenge.com">merlynstonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

__._,_.___
.

__,_._,___
Re: memory collection
country flaguser name
Canada
2007-08-20 19:39:16

jiqiang yao wrote:
&gt; Hi,
>
> I have five subroutines in a script.
>
> However, if I call them one by one in order, I have
>; memory problem. Instead, I call the first subroutine
> then exit the script. Next, I run the script only
>; calling the 2nd subroutine and so on. It works fine.
&gt;
> As you know, I have to run the script five times in
> order for all the subroutines to be done.
&gt;
> My question, how can I run the five subroutines one by
> one at once? how do I claim the memory allocated to
> each subroutine?

And what is the URL where you posted your code?

--
Just my 0.00000002 million dollars worth,
Shawn

"For the things we have to learn before we can do them, we learn by doing them.";
Aristotle

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )