Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Mar 2011 10:31:37 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Amit Dev <amitdev@gmail.com>
Cc:        freebsd-python@freebsd.org
Subject:   Re: Python malloc issue?
Message-ID:  <E2BA4AFE-0DA2-4F52-A861-96CE1DA33F77@mac.com>
In-Reply-To: <AANLkTikifWXgzzjm-P84d3Zq-ufZO4g5TugZsaQhBdmV@mail.gmail.com>
References:  <AANLkTikifWXgzzjm-P84d3Zq-ufZO4g5TugZsaQhBdmV@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 17, 2011, at 7:43 AM, Amit Dev wrote:
> This is using 165MB of memory. I really don't understand where the
> additional memory usage is coming from. [Size of both lists are same]
> 
> Python 2.6.4 on FreeBSD 7.2. On Linux and windows both uses around
> 100mb memory only.

It's possible that Linux and Windows are using Python's malloc, whereas FreeBSD might be using the native PHK or JE malloc.  (And it's not that surprising that different allocation patterns have different results in a garbage-collected environment.)

  http://docs.python.org/library/gc.html

...provides some info; consider importing gc and calling gc.collect() if you want to minimize the RAM needed to hold this big list of strings.

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E2BA4AFE-0DA2-4F52-A861-96CE1DA33F77>