473,321 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

struggling with memory release using ctypes wrapper

I was wondering if a ctypes expert could point me in the right
direction.

I am using the wrapper for the "freeimage" library to create multipage
TIFF files from a group of png images. The images load and save fine,
the problem seems to be that the memory used during the bitmap creation
isn't being released properly until the python program ends and python
exits.

The multipage tiff's are created in a loop (ie, creating 3 tiffs from a
group of 14 png files). As the loop progresses, the files are built,
but the amount of memory that is used and reported by Windows XP
taskmanager is not released until python program exits at which time
the amount of memory reported is exactly the same as the start of the
processing.

I am using WinXP SP2, Python 2.4.4, ctypes 1.0.1 and the latest
freeimage libarary and wrapper.

My questions is this,
I have scoured the freeimage site and am confident that I am making the
correct calls to the library and in the correct sequence to release the
resources allocated by the freeimage dll. After each call to unload
the resources, I have checked the return values, and every thing
*seems* ok in this regard.

I have even used the gc module in DEBUG mode and nothing is reported as
uncollectible.

My questions:
Is there some other method to evaluate a running python program to see
what memory is consumed and objects which have this memory allocated??

Nov 8 '06 #1
1 2057
Oops, found the problem in my code.
Sorry for wasting peoples time if you're viewing.

Nov 8 '06 #2

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

Similar topics

1
by: Srijit Kumar Bhadra | last post by:
Hello, Here are code snippets to create and access shared memory in Python with and without ctypes module. With regards, Srijit Filename : SharedMemCreate.py import msvcrt, mmap
0
by: Srijit Kumar Bhadra | last post by:
Hello, Here is some sample code with pywin32 build 203 and ctypes 0.9.6. Best regards, /Srijit File: SharedMemCreate_Mutex_win32all.py # This application should be used with...
5
by: Claudio Grondi | last post by:
Background information: --------------------------------- in order to monitor mainboard sensory data as fan speeds, temperatures, applications like SpeedFan http://www.almico.com/speedfan.php or...
3
by: Raphael Zulliger | last post by:
Hi I have to check wheter a .py script is run within the debug or the release version of an embedded python interpreter (in short, wheter python24_d.dll or python24.dll is in use). long...
5
by: tkondal | last post by:
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL=...
1
by: skip | last post by:
I am starting to experiment with ctypes. I have a function which returns a pointer to a struct allocated in heap memory. There is a corresponding free function for that sort of struct, e.g.: ...
2
by: Travis Oliphant | last post by:
I wanted to point anybody interested to a blog post that describes a useful pattern for having a NumPy array that points to the memory created by a different memory manager than the standard one...
0
by: Terry Reedy | last post by:
dudeja.rajat@gmail.com wrote: For CPython, an importable module written in C. There is a doc Extending and Embedding the Python Interpreter. But I expect you can write the class in Python with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.