Jump to content
Search Community

djavco

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by djavco

  1. I have found the culprit. it is BitmapData.copyPixels(); I am using BitmapData.draw() now. I am getting a more respectable 250Mb constant memory useage, as I would expect. I can only assume that copyPixels is caching the data with the expectation that it may be required and is obviously referencing where the data is being used, so only when the BlitMask is destroyed am I getting the memory back. I expect copyPixels is more appropriate where the graphics are going to be repeatedly re-used. I used this method because the adobe docs suggested it would be faster. Your help is much appreciated in eliminating the possibilities. Have a look here for an excellent tutorial on how BitmapData.draw() works: http://www.tomauger.com/2013/flash-actionscript/actionscript-3-bitmapdata-draw-offset-and-positioning
  2. Thanks for your answers. I am using Monster DeBugger for memory usage. Memory gets released when I set the BlitMask to null and call it's dispose() function. It's not crashing Flash I have got plenty of memory on my desktop. It just keeps on increasing the memory until it reaches about 650Mb once all the images have been used. It's almost like they are being cached. I am using the bitmpaData.copyPixels() to create the Bitmaps, but I am calling dispose() and setting them to null.
  3. So if I am adding Bitmaps to the Sprite (which is the target of the BlitMask) then removing them, calling dispose() and setting them to null these should be picked up by the gc? Are you sure BlitMask is not retaining references to these added and then removed Bitmaps?
  4. Just tried adding Bitmap display objects with unique references, removing them from the BlitMask target Sprite as they are no longer required, disposing of the bitmapData and setting the references to null. I am then disposing of the old Bimaps with: myBitmap.bitmapData.dispose(); myBitmap = null; and calling: System.pauseForGCIfCollectionImminent(0.1); after I have updated the BlitMask: myBlitMask.update(); The memory keeps going up with each new Bitmap added. Any help would be much appreciated.
  5. I am using copyPixels() to copy data from 12 large 3000x3600 bitmapData instances already loaded into memory. The data is being copied into a Bitmap which is the target for my BlitMask. I've tried all sorts of permutations of using bitmapData.dispose() but whatever I do everytime I use copyPixels on one of the instantiated images it adds about another 40Mb to my BlitMask (probably the size of the 8bit 3000x3600pixel image in cache) I try and force the garbage collection using System.pauseForGCIfCollectionImminent(0.01); but I only seem to increase the amount of memory being allocated. It is only when I dispose of the BlitMask that I can free up memory. Any ideas or should I try another approach? I have the feeling that because BlitMask caches the display object as a bitmapData object that it is also drawing in the cache created by the copyPixels() function. I am trying to make a music score scroller so I cannot interrupt the display of the image whilst the music is playing. Many Thanks
  6. Thanks for the tips I will make some tests and report the results back here. My initial thinking is to create a large BitmapData of the source score approximately 4000x 2040pxiels which will accomodate a music score of 18 minutes of music. I will use BitmapData copyPixels() in conjunction with the BlitMask.update().
  7. I am working on a music score application and I will need to create multiple bitmap images for the music score as they will exceed the 8,191 pixel width limitation. Can I use multiple images with BlitMask so that when I have reached the end one image another one comes in? Much in the way an image would wrap but in this case it would be a second or third etc... image?
×
×
  • Create New...