Hi,
I am using Python 2.5.1
I have an application that reads a file and generates a key in a
dictionary for each line it reads. I have managed to read a 1GB file and
generate more than 8 million keys on an Windows XP machine with only 1GB
of memory and all works as expected. When I use the same program on a
Windows 2003 Server with 2GB of RAM I start getting MemoryError exceptions!
I have tried setting the IMAGE_FILE_LARG E_ADDRESS_AWARE on both
Python.exe and Python25.dll and setting the /3GB flag on the boot.ini
file to no avail. I still get the MemoryError exceptions.
Has anybody encountered this problem before?
Thanks in advance for any ideas/suggestions.
Best Regards,
André M. Descombes 7 1508
amdescombes wrote:
Hi,
I am using Python 2.5.1
I have an application that reads a file and generates a key in a
dictionary for each line it reads. I have managed to read a 1GB file and
generate more than 8 million keys on an Windows XP machine with only 1GB
of memory and all works as expected. When I use the same program on a
Windows 2003 Server with 2GB of RAM I start getting MemoryError exceptions!
I have tried setting the IMAGE_FILE_LARG E_ADDRESS_AWARE on both
Python.exe and Python25.dll and setting the /3GB flag on the boot.ini
file to no avail. I still get the MemoryError exceptions.
Has anybody encountered this problem before?
Thanks in advance for any ideas/suggestions.
Best Regards,
André M. Descombes
How are you reading the large files? IMO, large files are better read in
chunks:
target_file = open(f, 'rb')
while 1:
data = target_file.rea d(8192000)
if data:
DO SOMETHING
else:
break
The above reads 8MB at a time until the file has been completely read.
Change the 8MB to whatever you like.
amdescombes wrote:
Hi,
I am using Python 2.5.1
I have an application that reads a file and generates a key in a
dictionary for each line it reads. I have managed to read a 1GB file and
generate more than 8 million keys on an Windows XP machine with only 1GB
of memory and all works as expected. When I use the same program on a
Windows 2003 Server with 2GB of RAM I start getting MemoryError exceptions!
I have tried setting the IMAGE_FILE_LARG E_ADDRESS_AWARE on both
Python.exe and Python25.dll and setting the /3GB flag on the boot.ini
file to no avail. I still get the MemoryError exceptions.
Has anybody encountered this problem before?
Thanks in advance for any ideas/suggestions.
Best Regards,
André M. Descombes
I forgot to mention that the OS itself or other processes may be using a
lot of memory. So, just because you have 2GB, that does not mean you can
access all of that at once. I would guess that 25% of memory is in
constant use by the OS. So, do your IO/reads in smaller chunks similar
to the example I gave earlier.
Brad
Hi Brad,
I do the reading one line at a time, the problem seems to be with the
dictionary I am creating.
Andre
amdescombes wrote:
>Hi,
I am using Python 2.5.1 I have an application that reads a file and generates a key in a dictionary for each line it reads. I have managed to read a 1GB file and generate more than 8 million keys on an Windows XP machine with only 1GB of memory and all works as expected. When I use the same program on a Windows 2003 Server with 2GB of RAM I start getting MemoryError exceptions! I have tried setting the IMAGE_FILE_LARG E_ADDRESS_AWARE on both Python.exe and Python25.dll and setting the /3GB flag on the boot.ini file to no avail. I still get the MemoryError exceptions.
Has anybody encountered this problem before?
Thanks in advance for any ideas/suggestions.
Best Regards,
André M. Descombes
I forgot to mention that the OS itself or other processes may be using a
lot of memory. So, just because you have 2GB, that does not mean you can
access all of that at once. I would guess that 25% of memory is in
constant use by the OS. So, do your IO/reads in smaller chunks similar
to the example I gave earlier.
Brad
AMD <am*********@gm ail.comwrote:
> I do the reading one line at a time, the problem seems to be with the dictionary I am creating.
I don't know whether Python dictionaries must live in a contiguous piece of
memory, but if so, that could be the issue. The system DLLs in Server 2003
have been "rebased" in such a way that they chop up the virtual address
space more than XP. Even though there is more virtual memory available, it
is fragmented.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Yes, I think that might be the issue, perhaps I could implement the
solution using several dictionaries instead of just one.
Are there any classes that implement disk based dictionaries?
Thanks,
Andre
>
I don't know whether Python dictionaries must live in a contiguous piece of
memory, but if so, that could be the issue. The system DLLs in Server 2003
have been "rebased" in such a way that they chop up the virtual address
space more than XP. Even though there is more virtual memory available, it
is fragmented.
On Mon, 15 Oct 2007 11:31:59 +0200, amdescombes wrote:
Are there any classes that implement disk based dictionaries?
Take a look at the `shelve` module from the standard library.
Or object databases like ZODB or Durus.
Ciao,
Marc 'BlackJack' Rintsch
Thanks Marc,
I just tried shelve but it is very slow :(
I haven't tried the dbs yet.
Andre
Marc 'BlackJack' Rintsch a écrit :
On Mon, 15 Oct 2007 11:31:59 +0200, amdescombes wrote:
>Are there any classes that implement disk based dictionaries?
Take a look at the `shelve` module from the standard library.
Or object databases like ZODB or Durus.
Ciao,
Marc 'BlackJack' Rintsch
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: scott_mcarthur2003 |
last post by:
We are running asp (not asp.net) and vb com dll web sites on a machine
which also has sql server 2000 sp3a running and uses Windows Server
2003. We recently migrated from Windows 2000 (same database) where we
had no problems. However on the new machine, despite much being much
more powerful and having the same usage, the box is periodically
grinding to a halt. The cause seems to be sql server using excessive
amounts of memory, it steadily...
|
by: Justice |
last post by:
Currently I'm doing some experimenting with the XMLHTTP object in
Javascript. Now,
the XMLHttp object is asynchronous (at least in this case), and the
following code causes a significant memory loss even though I seem to be
allocaitng everything; help would be *vastly* appreciated. What am I doing
wrong here? I thought I was doing everything correctly (setting things to
null, for example) but none of the memory seems to get replaced. ...
|
by: ccuthbert |
last post by:
I have a MCMS 2002 site that we recently had several hotfixes
installed. After installing the hotfixes, both AOL users and Earthlink
users experience tha same problem, namely that intermittently buttons,
and linkbuttons cause a post back but we don't seem to get the postback
event firing. The user sees the page post, but then the original page
comes back with the form empty. This occurs intermittently and does not
seem to be related to...
|
by: Larry Bertolini |
last post by:
I was browsing Microsoft's SQL Server site, looking for
some details about SQL Server 2005. Didn't find what
I was looking for...
I'm thinking about moving an existing SQL Server 2000
workload to a new box, using SQL Server 2005, and
maybe the 64-bit version.
My questions are:
|
by: Jon Trickey |
last post by:
We migrated to 8.1 from 7.2 this weekend. Everything ran ok over the
weekend, but we have a light user load then (about 200 users.) Today
when we had close to 600 users connecting and running applications,
the db2syscs.exe process started gobbling up memory until it hit about
1.7 gigs (which seems to be the limit from what I've read) then it
started crapping out.. We have shrunk the buffer pools to much lower
that they used to be in 7,...
| |
by: JCauble |
last post by:
We have a large Asp.net application that is currently crashing our production
servers. What we are seeing is the aspnet_wp eat up a bunch of memory and
then stop unexpectedly. Does not recycle.
Example:
After about 5 hours with a concurrent user base of about 150 users the
application raises the aspnet_wp memory usage by almost 500MB. If our server
guys modify the web.config this data is released and the workerprocess goes
back to a...
|
by: Anders K. Jacobsen [DK] |
last post by:
Hi,
We are running a intranet application (.net 1.1 asp.net) on a windows 2003
server. We are having some issues that causes extreem slowdowns (like 1 min
to show one page)
This happens usally when the (W3P..something) process reaches aprox 300 MB.
The server has 515 mb ram (2.4 Ghz) and is running a mssql server 2000.
While this is not a perfekt windows 2003 shouldnt be ok for a small user
group?
|
by: Florin |
last post by:
Hi all,
I have a problem related to memory grow on a server application
which is basically stateless (I have some static info loaded). The
client accesses this server using remoting and it has worked for about
2 years without problems.
The problem I have encountered lately is that the memory on server
side started to grow and not to be released. I have checked first new
functionalities but after isolating these on separate server, the...
|
by: Pablo Bianco SE |
last post by:
Hi everyone, I am new in this group. I have a question and would like to have
some support.
A customer is experiencing memory problems with the asp.net worker process.
The have an application installed on Windows 2003 Server (IIS6). We the
application starts the worker process ocuppies about 70MB, but it keeps
growing gradually during users activity. In just few hours (about 4 hours) it
can reach 800 MB, making the application not being...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |