struggling with memory release using ctypes wrapper

Discussion in 'Python' started by geskerrett, Nov 8, 2006.

  1. geskerrett

    geskerrett Guest

    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??
     
    geskerrett, Nov 8, 2006
    #1
    1. Advertisements

  2. geskerrett

    geskerrett Guest

    Oops, found the problem in my code.
    Sorry for wasting peoples time if you're viewing.
     
    geskerrett, Nov 8, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.