logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Out of memory perl script: msg#00105

Subject: Re: Out of memory perl script
On 25/11/2002 23:52:21 Jacob Schroeder wrote:

>I'm new to perl but I've been working on a script that will parse a large
>amount of text and while it's going through it, it will store data in a
few
>different hashes I have (a one dimensional hash, and two-two dimensional
>hashes).  Once I read in all the data, I then sort the hashes and output
all
>of this to a set of log files.
>

Pay attention, folks (Schwern, Vladi) !

>
>Here's the main chunk of my code that start the text coming in...
># Build up the command string appropriately, depending on what options
># have been set.
>my $command =
>($rlog_module ne "") ? "cvs -n -d $cvsdir rlog $rlog_module" : "cvs
>log";
>print "Executing \"$command\"\n" if $debug;
>
>open (CVSLOG, "$command |") || die "Couldn't execute \"$command\"";
>while (<CVSLOG>)
>{
>....

    You are adding stuff to hashes. Hashes use memory. If the log is huge,
    it will use a huge amount of memory.
>....
>}
>

Perl will happily consume all available memory in the system.
If it's limited to 20M that's too small to be a physical limitation.
Are you running on some Unix-like OS with things like ulimit ?

--
Csaba Ráduly, Software Engineer                           Sophos Anti-Virus
email: csaba.raduly@xxxxxxxxxx                        http://www.sophos..com
US Support: +1 888 SOPHOS 9                     UK Support: +44 1235 559933





Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe