-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
freeimage may not release memory #56
Comments
This could potentially solve issue #56.
My guess is that this could be solved by specifying https://github.com/luispedro/mahotas/compare/freeimage_keep_cache Let me know if it works and I will merge to master Tx |
Thank you for helping me. According this, my script was modified as follows : image list savedfreeimage.write_multipage(list_of_images, CurrentFileToStore, flags=0, keep_cache_in_memory=False) I didn't get successfull improvment, so I tried to modify again the line 605 with : Result is the same : I get a "Memory allocation failed" and memory monitoring from the Taskmanager remains the same. Al |
Hmm, sorry, then. I don't think you'll be able to do it with mahotas/freeimage. |
This introduces no changes to the default use, but allows for a power-user to pass through an option to freeimage. This is related to issue #56.
I'm closing this as I don't think it's doable within the current infrastructure. Best of luck, Luis |
If you're able to reopen this issue, I would like to suggess the following evolution inside the write_multipage script (coded inside freeimage.py): We didn't made a lot of trials, but raw data used for testing are now processed up to the end of the input file, output data seem to be not corrupted and the Taskmanager shows a constant used level of RAM during the process. Let us know your evaluation about this freeimage evolution. |
Oh, I'm always willing to consider patches... Do you have any documentation that this is the right way to call the freeimage API? I am traveling and had only time for a cursory look through their docs. |
The FreeImage_Unload() function is also used in the write() function in the freeimage.py script, line 602. I keep on testing this: with an input file of 11 GB (raw video where pixels are coded as UINT16), my script runs without any memory crash; the raw input file is transformed into tiff multipage files of 1000 images each. the Task manager gives me something like that : |
I try to convert a huge file of raw video data into many multipage TIFF files by using the "freeimage.write_multipage()" function of the freeimage package from the Mahotas library (Python 2.7). Unfortunately, it seems that this "very easy to use" function doesn't release memory when running the script. So, my script works fine for small input raw files (less than 1 GB) but crashes with bigger files (a 3 GB input file crashes with Win XP pro 32 - ram 3.2 GB). My goal is to convert input files up to 1.5 TB. An extract of the script below:
When I run my script, the Windows Task manager shows an increase of the used ram, output file after output file until the crash which release all the used ram :
![pb-memoire-creatiff](https://cloud.githubusercontent.com/assets/10732435/5928947/9e7d2c42-a67f-11e4-8ea5-54970adba602.JPG)
An extract of the reported error :
![erreur_freeimage](https://cloud.githubusercontent.com/assets/10732435/5928960/cca163c2-a67f-11e4-81eb-9feedaac52d8.JPG)
The text was updated successfully, but these errors were encountered: