Out of Memory When Using Bitmap Functions in LabWindows/CVIPrimary Software: LabWindows/CVI Development Systems>>Base PackagePrimary Software Version: 8.1 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I'm using some of the bitmap functions from the User Interface libraries in LabWindows/CVI ( NewBitmap, GetBitmapFromFile, ClipboardGetBitmap, etc). When I place these functions in a loop, my memory usage starts to go way up and I eventually run out of memory. I am not storing these bitmaps in any sort of data structure or array, just simply writing them to a file. What can I do to stop this memory leak and what is causing it? Solution: This is caused because these functions create a bitmap object everytime they are called. This causes the memory usage to grow quickly when inside a loop. To deallocate these objects and free up the memory used, call the function DiscardBitmap(int BitmapID) after you are done using each bitmap.Related Links: KnowledgeBase 2CQDSTA6: Improving Performance of LabWindows/CVI Applications Attachments:
Report Date: 02/20/2007 Last Updated: 03/01/2007 Document ID: 46J7FI9K |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
