Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Strings and numbers: losing memory and mind.

by kyle (Abbot)
on Sep 28, 2007 at 15:18 UTC ( [id://641551]=note: print w/replies, xml ) Need Help??


in reply to Re: Strings and numbers: losing memory and mind.
in thread Strings and numbers: losing memory and mind.

What you write is mostly true but not very relevant.

First, a correction: I originally wound up with 50 million strings averaging about 2.57 characters each (note that I split each line as it's read).

The fact that I'm replacing lots of undef with lots of strings isn't the problem. I observed that process, and when it was done, I had a certain amount of memory used. The problem is that memory usage continued to grow as I operated on (but did not add to) the arrays I'd created.

The problem is caused by the fact that Perl is converting all those strings to numbers for me on the fly. My solution was to force them to be numbers in the first place (instead of strings). Now, when I operate on the set, it stays the same size.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://641551]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found