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.
In reply to Running out of Memory by nwboy74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |