This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: MemoryError when working on large dictionaries on Windows 2003 Server
Type: resource usage Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amdescombes, loewis
Priority: normal Keywords:

Created on 2007-10-12 10:02 by amdescombes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unnamed amdescombes, 2007-10-12 11:41
unnamed amdescombes, 2007-10-12 11:59
unnamed amdescombes, 2007-10-12 12:23
unnamed amdescombes, 2007-10-12 12:41
unnamed amdescombes, 2007-10-12 12:53
Messages (10)
msg56361 - (view) Author: Andre M. Descombes (amdescombes) Date: 2007-10-12 10:02
Hi everybody,

I am using Python 2.5.1.
I am creating a rather large dictionnary, with more than 8 million
entries, memory usage should be about 1.5GB. If I run the program on
Windows XP all runs fine, if I run the program on Windows Server 2003 I
start getting MemoryError exceptions around the 1GB boundary.
Is there a known issue with Windows 2003 Server?

Thanks,

André M. Descombes
msg56362 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-12 10:20
Please understand that the purpose of this bug tracker is to track bug
reports and patches to Python, not a means of getting help in using
Python. If you think you have found a bug, please submit a bug report
that allows us to reproduce the bug. If you merely need help, please use
some of the Python community channels, such as python-list@python.org.

As for your question: I'm not aware of an issue with Windows 2003 server
that could explain that behavior. Most likely, you get the MemoryError
because you really ran out of memory. Try increasing the page file, and
put more main memory into the machine.
msg56363 - (view) Author: Andre M. Descombes (amdescombes) Date: 2007-10-12 11:41
Martin,

it is really a bug, as I have tried on a machine with Windows 2003 server
and 4GBs of ram and it still doesn't run, and it does run on xp with only
1GB of ram.
Does python.exe have then IMAGE_FILE_LARGE_ADDRESS_AWARE bit set, that could
explain the behaviour it its not set.

Thanks,

Andre M. Descombes

On 10/12/07, Martin v. Löwis <report@bugs.python.org> wrote:
>
>
> Martin v. Löwis added the comment:
>
> Please understand that the purpose of this bug tracker is to track bug
> reports and patches to Python, not a means of getting help in using
> Python. If you think you have found a bug, please submit a bug report
> that allows us to reproduce the bug. If you merely need help, please use
> some of the Python community channels, such as python-list@python.org.
>
> As for your question: I'm not aware of an issue with Windows 2003 server
> that could explain that behavior. Most likely, you get the MemoryError
> because you really ran out of memory. Try increasing the page file, and
> put more main memory into the machine.
>
> ----------
> nosy: +loewis
> resolution:  -> invalid
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1270>
> __________________________________
>
msg56364 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-12 11:55
No, Python does not have IMAGE_FILE_LARGE_ADDRESS_AWARE set; that's not
a bug, though.

In any case, the lack of this flag cannot explain why your application
works on Windows XP and not on Windows 2003.
msg56365 - (view) Author: Andre M. Descombes (amdescombes) Date: 2007-10-12 11:59
Apparently, XP is more lax when it comes to checking this flag on the
programs it runs then Windows 2003 Server. I am currently doing a test where
I have manually added the flag to python to see if this makes the problem go
away. I will post my results as soon as I have them.

Andre M. Descombes
msg56366 - (view) Author: Andre M. Descombes (amdescombes) Date: 2007-10-12 12:23
I set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag on python and I still get the
memoryerror exceptions. When they start happening there is still more than
1GB of available memory!
msg56367 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-12 12:36
> I set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag on python and I still get the
> memoryerror exceptions. When they start happening there is still more than
> 1GB of available memory!

Just in case it isn't clear: I still don't see an indication of a bug in
Python here. If Python reports MemoryError, it likely means that the
system has refused to provide Python with more memory, whether or not
it has memory available for other purposes.

Martin
msg56368 - (view) Author: Andre M. Descombes (amdescombes) Date: 2007-10-12 12:41
Ok, so where would you recommend I move this discussion to?

Andre

On 10/12/07, Martin v. Löwis <report@bugs.python.org> wrote:
>
>
> Martin v. Löwis added the comment:
>
> > I set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag on python and I still get
> the
> > memoryerror exceptions. When they start happening there is still more
> than
> > 1GB of available memory!
>
> Just in case it isn't clear: I still don't see an indication of a bug in
> Python here. If Python reports MemoryError, it likely means that the
> system has refused to provide Python with more memory, whether or not
> it has memory available for other purposes.
>
> Martin
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1270>
> __________________________________
>
msg56369 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-12 12:48
I personally don't think this problem can be resolved by discussion.
Instead, you have to use a debugger, debug your application, Python, and
Windows, to find out the true cause of the problem. Only then discussion
can be fruitful.

If you cannot do these steps yourself, consider hiring somebody for you
who can.

If you still want to discuss, try python-list.
msg56371 - (view) Author: Andre M. Descombes (amdescombes) Date: 2007-10-12 12:53
Thanks Martin,

I think you are right, perhaps someone on the python-list will have seen and
solved the problem before.

Andre
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45611
2007-10-12 12:53:48amdescombessetfiles: + unnamed
messages: + msg56371
2007-10-12 12:49:00loewissetmessages: + msg56369
2007-10-12 12:41:46amdescombessetfiles: + unnamed
messages: + msg56368
2007-10-12 12:36:56loewissetmessages: + msg56367
2007-10-12 12:23:13amdescombessetfiles: + unnamed
messages: + msg56366
2007-10-12 11:59:32amdescombessetfiles: + unnamed
messages: + msg56365
2007-10-12 11:55:19loewissetmessages: + msg56364
2007-10-12 11:41:16amdescombessetfiles: + unnamed
messages: + msg56363
2007-10-12 10:20:56loewissetstatus: open -> closed
2007-10-12 10:20:51loewissetresolution: not a bug
messages: + msg56362
nosy: + loewis
2007-10-12 10:02:24amdescombescreate