I have a perl program (don't you hate it when people call them 'scripts') that processes thousands of xml files that have been individually tgz compressed.
I have been plagued by apparently random failures during "extract" in Archive::Extract. After hours debugging, I believe that the root cause is apparently inside Cwd::cwd, which is used by Archive::Extract. The cwd() function calls '/bin/pwd' via backticks - this works fine most of the time, but I finally caught a case where it returns undef.
At the time it returns undef, I examined $!, which contained - you guessed it - 'Cannot allocate memory'.
The underlying tgz/xml file DOES process successfully when passed through the program individually, or in a small group of files.
Please advise how to diagnose further, or other recommend steps. UPDATE : Here is the failure I get:
OS: Linux ManchineName 2.6.28-19-server #64-Ubuntu SMP Wed Aug 18 22:43:50 UTC 2010 x86_64 GNU/LinuxKey 'archive' (filename.gz) is of invalid type for 'Archive::Extract:: +new' provided by main::parse_XML at PerfDBparse.pl line 447 at /usr/share/perl/5.10/Params/Check.pm line 345 Params::Check::check('HASH(0x2a3e660)', 'HASH(0x2a3e5a0)') cal +led at /usr/local/share/perl/5.10.0/Archive/Extract.pm line 227 Archive::Extract::new('Archive::Extract', 'archive', 'FileName +.gz') called at PerfDBparse.pl line 447 main::parse_XML('filename', 'allXML', 288600) called at PerfDB +parse.pl line 131 ...(Truncated, and file names changed to protect the innocent). +..
Memory info at time of failure:
This is the first time I'm dealing with an apparent memory leak. Any known issues ? BTW, I use XML::Bare for XML parsing.dmin [ ~ ]$ free -m total used free shared buffers cac +hed Mem: 1987 1873 114 0 125 +275 -/+ buffers/cache: 1471 515 Swap: 475 33 442
Syntactic sugar causes cancer of the semicolon. --Alan Perlis
In reply to backticks and 'Cannot allocate memory' by NetWallah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |