Re: How to deal with python 32bit memory error

Discussion in 'Python' started by Dave Angel, Jul 24, 2012.

  1. Dave Angel

    Dave Angel Guest

    On 07/24/2012 04:06 AM, Sammy Danso wrote:
    > Hello Experts,
    > I am having a 'memory error',


    Please post the actual error message.

    > which suggest that I
    > have run out of memory, but I am not sure this is the case as I have
    > considerable amount of memory unused on my computer.


    What OS, version, and bitness. What 32bit Python?

    How do you know you have unused memory? How much total memory, how much
    swapspace, and what are you using to tell how much of each is unused?

    How big is the process when it dies? And how are you determining that?

    > A little
    > search suggest this is a limitation of python 32 and an option is to
    > have a 64bit. I however have other plug-ins, which are tied to the 32bit
    > so this is not the best option in my case.

    There are some limitations to 32 bits, that have nothing to do with
    Python specifically. However, they have different impact, depending on
    the environment you're running in. First and foremost, address are
    32bits, which limits them to 4gb of ram. So out of your 32Gig of
    swapspace, a best-case maximum regardless of OS is 4Gig. No operating
    system lets you actually get that high.

    > I was wondering whether there is an elegant way to dealing with this without installing a 6bit version of python.


    The most elegant way of solving it is to reduce the amount of memory
    your program is using. For example, instead of building large lists,
    perhaps you can use generators. Simplest example (for Python 2.x) is
    xrange rather than range.

    For another example, reduce the globals. Create large objects inside a
    limited function, and discard them when done (by returning from the
    function).

    > Thanks very much in advance.
    > Sammy
    >


    When responding, please remember to post your response *AFTER* the part
    you're quoting. Most of your previous posts here have been top-posted.

    --

    DaveA
     
    Dave Angel, Jul 24, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rbt

    deal or no deal

    rbt, Dec 22, 2005, in forum: Python
    Replies:
    7
    Views:
    569
    Duncan Smith
    Dec 28, 2005
  2. Explore_Imagination
    Replies:
    3
    Views:
    1,974
    Saju Pillai
    Dec 11, 2008
  3. Gregory Ewing
    Replies:
    2
    Views:
    486
    Ned Deily
    Jul 11, 2011
  4. miamia
    Replies:
    1
    Views:
    357
    Andrew Berg
    Jun 24, 2011
  5. Francois Grieu
    Replies:
    12
    Views:
    839
    Malcolm McLean
    Apr 28, 2012
Loading...

Share This Page