| | |
Memory Managment?
![]() |
•
•
Join Date: Jan 2009
Posts: 106
Reputation:
Solved Threads: 5
Hello all.
I have a small problem.
I have a crewler, that gets into one website and extract some info from it, and writes the exctracted content to file.
The only prob, that in 3~4hours of work, thise script uses 1 gig of ram.
THere is the part of the code, i tryied the undef function(at the end of for cycle) but the sam ram was used after 3~4hours of crewling.
So i would like to know, if is it possible to clean the memory at the end of the for cycle, and how .
Thanks in advance.
I have a small problem.
I have a crewler, that gets into one website and extract some info from it, and writes the exctracted content to file.
The only prob, that in 3~4hours of work, thise script uses 1 gig of ram.
Perl Syntax (Toggle Plain Text)
for(my $increment = 1; $increment <= 999999; $increment++){ my $funky = "http://www.website.com/page?id=".$increment; print $increment."\n"; my $content = get($funky);
So i would like to know, if is it possible to clean the memory at the end of the for cycle, and how .
Thanks in advance.
Why don't you call an external binary e.g. curl to get the content.
You might want to add some headers (at least user agent) so the site doesn't block you by detecting the user agent string.
Executing an external binary will be a separate process and the memory will be released by the OS.
You might want to add some headers (at least user agent) so the site doesn't block you by detecting the user agent string.
Executing an external binary will be a separate process and the memory will be released by the OS.
![]() |
Similar Threads
- necessarry or not (memory managment) (C++)
- Access Reading Violation (C++)
- Working in Visual C++ to parse some text files (C++)
- Python as a first language (Python)
- how computer work (Computer Science)
- About Implementing Scratch Disks (C++)
Other Threads in the Perl Forum
- Previous Thread: Backreference Variables
- Next Thread: script cancels with message but no illegal operation
| Thread Tools | Search this Thread |





