Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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

by kyle (Abbot)
on Sep 28, 2007 at 15:18 UTC ( #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.

  • Comment on Re^2: Strings and numbers: losing memory and mind.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2023-06-04 21:14 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (22 votes). Check out past polls.