I have programmed a puzzle that uses a buzzing image for each piece. This is done because it has a specific shadow and is marked on it. When I mix two pieces, I made a new buffard image, for it to paint two pieces, and throw away all references to the old paintings. My problem is that while solving a puzzle with 100 or so pieces, the program piles up more and more memory without running the garbage collection, and when it finally decides to clean, remember this Because the memory was too low to run the remaining free garbage collection. Either way, can I ask to collect garbage collection more often and during the game instead of waiting for the last moment?
You can still place indirect references for BufferedImage. For example:
Graphics G = Buffer img.track graphics (); BufferedImg = null; // You still have an indirect reference through the graphics object G! In addition, there may be a native resource allocated with BufferedImage and / or its graphics, which may delay the garbage collection of these items (depending on the JRE implementation) You can point to these resources by calling graphics.dezos () and Buffered image.flas ().
Comments
Post a Comment