472,344 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

Memory Management in python 2.5

Hi, I am starting to have a look to a python program that does not free
memory (I am using python 2.4.3). As I have read about a new memory
management in python 2.5 (http://evanjones.ca/python-memory.html) I
decided to try the program with the new version.
With the new version of python the memory consumption is the same. Now
I am asking myself if python 2.5 has any improving in memory
management or maybe not yet. Thank you.

-- Cesar

Oct 9 '06 #1
4 1723
ce*********@gmail.com skrev:
Hi, I am starting to have a look to a python program that does not free
memory (I am using python 2.4.3). As I have read about a new memory
management in python 2.5 (http://evanjones.ca/python-memory.html) I
decided to try the program with the new version.
With the new version of python the memory consumption is the same. Now
I am asking myself if python 2.5 has any improving in memory
management or maybe not yet. Thank you.
In previous versions Python collected memory, but never released it
again. It simply kept on to it, so it could reuse it again later.

From 2.5 onwards it should release most of the unused memory. However
it doesn't use less memory. The peak memory usage should be the same as
before. So for one-off programs that starts up and runs once, there
should not be much gain.
--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
Oct 9 '06 #2
ce*********@gmail.com wrote:
Hi, I am starting to have a look to a python program that does not free
memory (I am using python 2.4.3). As I have read about a new memory
management in python 2.5 (http://evanjones.ca/python-memory.html) I
decided to try the program with the new version.
With the new version of python the memory consumption is the same. Now
I am asking myself if python 2.5 has any improving in memory
management or maybe not yet.
the new mechanism only helps if you temporarily create large structures and release
them quickly; it does not help if you're *fragmenting* the memory. Python requests
memory from the underlying system in blocks (called "arenas"), and it can only re-
turn them if they're entirely empty.

(this is discussed on the page you link to, and the various posts it links to).

</F>

Oct 9 '06 #3
I just checked the comsuptiom with the 'top' unix util. I am procesing
html docs and the amount of memory rises continiously.
I am using a lot of lists and docs. Some of them with objects. Do i
have to make any special thing in order to get them released back to
the Memory Manager? For instantec.. is it enough to do a clear() in a
dictionary?

-- Cesar

Oct 9 '06 #4
ce*********@gmail.com wrote:
>I just checked the comsuptiom with the 'top' unix util. I am procesing
html docs and the amount of memory rises continiously.
what library are you using for this ?
I am using a lot of lists and docs. Some of them with objects. Do i
have to make any special thing in order to get them released back to
the Memory Manager? For instantec.. is it enough to do a clear() in a
dictionary?
the garbage collector should take care of that, unless you're doing something
fishy. maybe you're keeping pointers to documents you've already processed
in some data structure somewhere?

</F>

Oct 9 '06 #5

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

Similar topics

3
by: Marcelo A. Camelo | last post by:
Hi! I will be presenting Python to an audience of game developers, mostly C/C++ programmers. In my presentation I will talk about using python...
9
by: Chris S. | last post by:
Is it possible to determine how much memory is allocated by an arbitrary Python object? There doesn't seem to be anything in the docs about this,...
35
by: Alex Martelli | last post by:
Having fixed a memory leak (not the leak of a Python reference, some other stuff I wasn't properly freeing in certain cases) in a C-coded extension...
18
by: diffuser78 | last post by:
I have a python code which is running on a huge data set. After starting the program the computer becomes unstable and gets very diffucult to even...
11
by: Hari Sekhon | last post by:
I do import zipfile zip=zipfile.ZipFile('d:\somepath\cdimage.zip') zip.namelist() then either of the two: A) ...
11
by: seberino | last post by:
Suppose a C extension locally built an array of PyObject* 's as follows... my_array = malloc(n * sizeof(PyObject*)); for (i = 0; i < n; i++) {...
1
by: Joe Peterson | last post by:
I've been doing a lot of searching on the topic of one of Python's more disturbing issues (at least to me): the fact that if a __del__ finalizer is...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but...
3
by: Hank | last post by:
Steve Holden wrote: Hi, Steve, This not simply a pathological condition. My people are keeping trying many ways to have job done, and the memory...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

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.