CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Strange memory leak question. Please help!


New User

Sep 21, 2007, 8:33 AM

Post #1 of 2 (345 views)
Strange memory leak question. Please help! Can't Post

In my code, I read information from MySQL database, grab a web page (using LWP) from the Internet, analyze the content, store something to the database, and grab the next page. This operation may repeat many times.

But I found that the memory was continuously consumed and program crashed finally due to "out of memory". Although memory should be released after each web page is analyzed.

What I have done is to delete all the arrays after they are useless. But the problem is still there.

Could anybody give me some suggestions about the possible reasons? The code is long so I won't want to post it here. Do I have to release LWP objects too?



Sep 21, 2007, 9:51 AM

Post #2 of 2 (343 views)
Re: [catsophie] Strange memory leak question. Please help! [In reply to] Can't Post

Are you compiling your perl program with "strict" and lexically declaring your variables with "my"? That should solve most of your memory leakage problems right there. If not then you have to try and determine where the memory leakage is occuring. There might be some modules on CPAN that can help track down problems like this but I don't know off the top of my head.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives