nwboy74 has asked for the wisdom of the Perl Monks concerning the following question:
I have a long-running, complex perl process that downloads pages, extracts a couple of strings that get stored in a hash, and continues. After the page is initially downloaded, it is stored as an array of lines. I was watching memory use on a Windows machine while it ran and after every page, the memory usage jumped 2MB, but doesn't ever go back down. Eventually, I get an access violation error and the whole thing shuts down.
It's as if the arrays aren't getting garbage collected, but I've examined the reference count just prior to the reference leaving scope and it only has one reference (using Devel::Peek Dump).
SV = RV(0x1a36f28) at 0x1b78394
REFCNT = 1
FLAGS = (PADBUSY,PADMY,ROK)
RV = 0x1b78b8c
SV = PVAV(0x1b6c41c) at 0x1b78b8c
REFCNT = 1
FLAGS = (PADBUSY,PADMY)
...
I'm not sure what else to check. The computer that is running the script only has 512MB of RAM and the memory use just climbs and climbs the longer it runs. Like I say, I'm only storing what amounts to a phone number and address from each page in a hash. There's no way that one phone number/address is taking 2MB.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running out of Memory
by Khen1950fx (Canon) on Oct 07, 2010 at 22:42 UTC | |
|
Re: Running out of Memory
by bluescreen (Friar) on Oct 07, 2010 at 22:34 UTC | |
|
Re: Running out of Memory
by Anonymous Monk on Oct 07, 2010 at 21:45 UTC | |
by nwboy74 (Novice) on Oct 07, 2010 at 22:16 UTC | |
by Anonymous Monk on Oct 07, 2010 at 23:37 UTC | |
|
Re: Running out of Memory
by aquarium (Curate) on Oct 08, 2010 at 04:25 UTC |