Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^6: statistics of a large text

by perl_lover_always (Acolyte)
on Feb 10, 2011 at 11:13 UTC ( [id://887413]=note: print w/replies, xml ) Need Help??


in reply to Re^5: statistics of a large text
in thread statistics of a large text

Since you are more expert in memory usage and related issues, I have a question. Why when I store my 5 gb of file which has about 7m records of two columns, and I make two hashesh from two different files in the same format and size, even with a large ram (50gb) I run out of memory?

Replies are listed 'Best First'.
Re^7: statistics of a large text
by BrowserUk (Patriarch) on Feb 10, 2011 at 12:44 UTC

    What does perl -V output on your system?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      This is perl, v5.8.8 built for x86_64-linux-thread-multi
Re^7: statistics of a large text
by BrowserUk (Patriarch) on Feb 10, 2011 at 14:13 UTC
    Why when I store my 5 gb of file which has about 7m records of two columns, and I make two hashesh from two different files in the same format and size, even with a large ram (50gb) I run out of memory?

    Assuming that your OS and Perl allow you full access to the full 50GB, you should not be running out of memory.

    On a 64-bit system, a HoAs with 7 million keys and an average of 10 numbers per array requires ~3.5 GB. For two, reckon on 10 GB max.

    I'm not aware of any restrictions or limits on the memory a 64-bit Perl can address, which leave you OS. Linux can apply per-process (and per-user?) limits to memory and cpu usage. I don't know what the commands are for discovering this information, but meybe that is somewhere you should be looking.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I have no idea since I can access the whole memory (all 50 GB) Do you think it has something to do with my code?
        I have no idea since I can access the whole memory (all 50 GB)

        How do you know you can access the whole of memory?

        What happens if you run this code?:

        perl -e' $x = chr(0) x ( 1024**3 * 12 ) '

        That will attempt to allocate a single 12GB lump of memory. If it fails, then try adjusting the 12 to a lower value to discover how much memory Perl can actually allocate.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        Do you think it has something to do with my code?

        It is beginning to look that way. Can you post the latest version of your code?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        Time to ask your systems administrator to check if there are any limitations in place. Check ulimit -a and man limits.conf.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://887413]
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-04-23 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found