[ python-Bugs-1006740 ] Possible memory leak in output console
SourceForge.net
noreply at sourceforge.net
Wed Aug 11 16:39:30 CEST 2004
Bugs item #1006740, was opened at 2004-08-10 13:14
Message generated for change (Settings changed) made by akuchling
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1006740&group_id=5470
Category: Windows
Group: Platform-specific
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Kirk Strauser (kstrauser)
Assigned to: Nobody/Anonymous (nobody)
Summary: Possible memory leak in output console
Initial Comment:
I've written a bridge adapter to connect my company's
Unix servers to our Foxpro database, and it runs as a
command line program under Python 2.3.4 (with Python
for Windows Extensions build 202) on a Windows XP
server. Basically, it listens for incoming SQL queries from
the Unix servers (via the Python Web Services
implementation of SOAP), executes them with ADODB,
and returns the results via SOAP.
The system works as desired, except that we've been
triggering a memory leak with the program has been
running for long periods of time, to the tune of about .5GB
of memory per month. I've recently noticed that the rate
of leak is proportional to the amount of console output
that the program generates (the debugging level is
remotely adjustable via a SOAP method), and that I can
consistently reclaim the memory by the act of minimizing
the console window.
That is, at this very moment, the window is minimized
and the task manager is reporting that the application is
using 64,908KB of memory.
If I restore the window to its normal size, the memory
allocation stays about the same.
If I then re-minimize the window, usage drops to 280KB.
It will then gradually increase again until the server
begins to bog down, at which point I can repeat the
process of restoring and then minimizing the console
window.
In other words, leaving the window "open" does not help,
nor does leaving it minimized; only the act of minimizing
an "open" window is sufficient to reduce the
eternally-growing memory footprint. This is completely
reproducible, and I was having the same problem with
Python 2.3.3 before upgrading it yesterday.
----------------------------------------------------------------------
>Comment By: A.M. Kuchling (akuchling)
Date: 2004-08-11 10:39
Message:
Logged In: YES
user_id=11375
Closing as suggested by ncoghlan; this doesn't look like
Python's problem, but rather the console's.
----------------------------------------------------------------------
Comment By: Nick Coghlan (ncoghlan)
Date: 2004-08-11 02:33
Message:
Logged In: YES
user_id=1038590
What are you using to measure your 'memory usage'?
If you are looking at the 'Mem Usage' column in Windows,
then that is completely meaningless.
To get a meaningful number, you need to go to View->Select
Columns and check 'Virtual Memory Size'
The new column 'VM Size' will now show you how much memory
your application has actually allocated, rather than how
much it currently has paged into RAM.
What you are seeing with the significant drop in 'Mem Usage'
is Windows throwing most of your program's data set out of
physical RAM when you minimise it.
Now, as to where your 'leak' is coming from - that console
display ain't free. Windows has to buffer that data
somewhere - and that's in RAM.
So if you want to eliminate your 'leak' start the app with
stdout piped to a file.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1006740&group_id=5470
More information about the Python-bugs-list
mailing list