且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

连续加载图像时出现内存不足异常

更新时间:2023-01-14 15:04:25

垃圾收集器释放该内存可能会有一段时间.

There may be a time lag for the Garbage Collector to release that memory.

为减少内存消耗,请确保每个图像的尺寸(以像素为x和y方向)保持尽可能小. JPG可以扩展以消耗大量内存.

To reduce memory consumption be sure the size of each image (x and y direction in pixels) is kept as low as possible. A JPG can expand to consume a LOT of memory.

还要检查您可能正在创建但未无效的其他对象.留意引用其他对象的对象,以防止后者被垃圾收集器释放.

Also check for other objects that you may be creating but not nullifying. Watch for objects that reference other objects, preventing the latter objects from being released by the garbage collector.

希望这会有所帮助,
标记

Hope this helps,
Mark