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

Home Posts Topics Members FAQ

python memory blow out

I have written some software which proxy's SQL Server database
services across a network. It uses Pyro, without multiuthreading. It
creates and closes a new connection and cursor object for each
request.

Unfortunately, the memory consumption blows out (consuming all
available memory) when a large SQL query is run. This is not a problem
in itself; the problem is that Python does not release this memory
back to the operating system once it has finished with the result set.

I've noticed others have been frustrated by this problem also:
http://mail.python.org/pipermail/pyt...er/049483.html

According to the above post:
a) If the allocation is > 256 bytes, call the system malloc.
b) If the allocation is < 256, use its own malloc implementation, which
allocates memory in 256 kB chunks and never releases it.


I imagine this means that large memory allocations are eventually
released back to the operating system. However, in my case, this
appears to be not happening.

Does anyone have ideas on why this is occuring, or how I might
otherwise prevent memory blow out?

Sw.
Jul 18 '05 #1
1 1603
Simon Wittber wrote:

Does anyone have ideas on why this is occuring, or how I might
otherwise prevent memory blow out?


I don't know it this is a decent enough solution but
if I were you I would try running the SQL service
in a subshell. Within this subshell I would
terminate then restart the program after a large
query and keep it going after small ones.

The clients then would need to have some tolerance
for the service being offline for short periods.

Just a guess.

Istvan.
Jul 18 '05 #2

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

Similar topics

8
3193
by: Eric Brunel | last post by:
Hi all, I was creating a Tkinter widget in the style of the reversed tabs below Excel worksheets and I stepped in a serious problem: the code I made makes python crash with a seg fault, bus...
113
5184
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
18
2700
by: Matt Garman | last post by:
I'm trying to use Python to work with large pipe ('|') delimited data files. The files range in size from 25 MB to 200 MB. Since each line corresponds to a record, what I'm trying to do is...
2
4735
by: Gary Robinson | last post by:
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...
0
7118
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
7323
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
7379
jinu1996
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...
1
7038
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...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
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
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
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.