473,508 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

32-bit python memory limits?

I'm running a Python job on OS X 10.5.3 and the Python 2.5.2 that's available as a binary download at python.org for OS X.

I ran a python program tonight that ended up using much more memory than anticipated. It just kept on using more and more memory. Instead of killing it, I just watched it, using Activity Monitor. I assumed that when it had 2GB allocated it would blow up, because I thought 32-bit python could only address 2GB.

But Activity Monitor reported that it had allocated 3.99GB of virtual memory before it finally blew up with malloc errors. Was my understanding of a 2GB limit wrong? I guess so! But I'm pretty sure I saw it max out at 2GB on linux...

Anybody have an explanation, or is it just that my understanding of a 2GB limit was wrong? Or was it perhaps right for earlier versions, or on linux...??

Thanks for any thoughts,
Gary
--

Gary Robinson
CTO
Emergent Music, LLC
personal email: ga*****@mac.com
work email: gr*******@emergentmusic.com
Company: http://www.emergentmusic.com
Blog: http://www.garyrobinson.net
Jun 27 '08 #1
2 4735
Gary Robinson wrote:
I'm running a Python job on OS X 10.5.3 and the Python 2.5.2 that's available as a binary download at python.org for OS X.

I ran a python program tonight that ended up using much more memory than anticipated. It just kept on using more and more memory. Instead of killing it, I just watched it, using Activity Monitor. I assumed that when it had 2GB allocated it would blow up, because I thought 32-bit python could only address 2GB.

But Activity Monitor reported that it had allocated 3.99GB of virtual memory before it finally blew up with malloc errors. Was my understanding of a 2GB limit wrong? I guess so! But I'm pretty sure I saw it max out at 2GB on linux...

Anybody have an explanation, or is it just that my understanding of a 2GB limit was wrong? Or was it perhaps right for earlier versions, or on linux...??

Thanks for any thoughts,
Gary

Yep, 2Gb is only 31 bits. 4Gb is 32 bits (since memory address is an unsigned).

-Larry
Jun 27 '08 #2
On 2008-06-24, Gary Robinson <ga*****@mac.comwrote:
I'm running a Python job on OS X 10.5.3 and the Python 2.5.2
that's available as a binary download at python.org for OS X.

I ran a python program tonight that ended up using much more
memory than anticipated. It just kept on using more and more
memory. Instead of killing it, I just watched it, using
Activity Monitor. I assumed that when it had 2GB allocated it
would blow up, because I thought 32-bit python could only
address 2GB.
You assumed incorrectly. :)
But Activity Monitor reported that it had allocated 3.99GB of
virtual memory before it finally blew up with malloc errors.
Was my understanding of a 2GB limit wrong? I guess so! But I'm
pretty sure I saw it max out at 2GB on linux...
You may have been using a Linux kernel with a 2GB user VM
limit.
Anybody have an explanation, or is it just that my
understanding of a 2GB limit was wrong? Or was it perhaps
right for earlier versions, or on linux...??
In the past, it was pretty common for Linux kernels to be
configured so that a user-space program had 2GB of virtual
address space. For reasons that aren't really important here,
doing so made it simpler to manage various kernel vs. user
memory issues. Back when nobody could afford more than a few
hundred MB of RAM, that made sense. These days, the Linux
kernel can be built for 2GB, 3GB or 4GB of VM space. There's a
tiny bit of extra overhead if you pick 3GB or 4GB, so users
with 2GB or less of physical RAM still often configure kernels
for a 2GB limit.

http://kerneltrap.org/node/2450

--
Grant Edwards grante Yow! Can you MAIL a BEAN
at CAKE?
visi.com
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
587
by: Mike Ruskai | last post by:
I've searched Google every way I know how, and came up with two answers that refer to MAX_KEY and MI_MAX_KEY, along with a typedef for key_map. I have the 4.1.1 alpha source (4.0 is no good,...
20
2376
by: Ivar | last post by:
Hi, For my supprise I found that functions have 32 parameter limit. Where to find more info about this limitation or similar limitations ? I need at least 50, 100 would be ok. Real life...
5
5749
by: Ian Rutherford | last post by:
Heya guys, It seems VB .net no longer supports the awesome ability of VB 6 to declare something as a string and specify how long the string would be all in one line: Public myString as String *...
6
3864
by: barcaroller | last post by:
I couldn't find a message-digest newsgroup, so I posted here. I have a C function that converts a string of arbitrary length to a 32-bit hash value. I realize this is overkill but I used...
9
2054
by: beni.cherniavsky | last post by:
Python seems to be missing a UCS-32 codec, even in wide builds (not that it the build should matter). Is there some deep reason or should I just contribute a patch? If it's just a bug, should I...
16
11199
by: chandanlinster | last post by:
As far as I know floating point variables, that are declared as float follow IEEE format representation (which is 32-bit in size). But chapter1-page no 9 of the book "The C programming language"...
10
2675
by: lesperancer | last post by:
you start with a small application in access97, then you have more modules and more... and you reach the point where tables like 'item' and 'employee' reach the limit and you know there's more...
3
2039
by: Barry | last post by:
void func(int array) { for (int i = 0; i < 32; ++i) cout << array << ' '; } as the code above shows, I know int array here will decay into int *, but I still find the number 32 useful for...
2
4802
by: Jeffrey Walton | last post by:
Hi All, BMP Strings are a subset of Universal Strings.The BMP string uses approximately 65,000 code points from Universal String encoding. BMP Strings: ISO/IEC 10646, 2-octet canonical form,...
6
6422
by: docbook.xml | last post by:
I have the following in the XHTML 1.0 Strict page: <meta http-equiv="Content-Type" content="text/html;charset=utf-32" /> However W3 validator complains that "The character encoding specified in...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.