Marcos Alves Well-Known Member Licensed User Longtime User Jun 2, 2018 #1 Hi, I'm having some problems with gifdecoder... when trying to load big gif files with this, I'm get the error: java.lang.OutOfMemoryError: Failed to allocate a 1920012 byte allocation with 242424 free bytes and 236KB until OOM Code: Copy Dim EncGIF As AnimatedGifEncoder Dim DecGIF As GifDecoder File.Copy(sourcedir,sourcefile,File.DirInternal,"temp.gif") Log("gif size -> " & File.Size(File.DirInternal,"temp.gif")) DecGIF.Load(File.DirInternal,"temp.gif")'<< original gif path It looks that is occurring because the library tries to load all the frames in the memory. If I had the source code could try to load the frame only when required, reducing a lot the memory use... Does anybody can help?
Hi, I'm having some problems with gifdecoder... when trying to load big gif files with this, I'm get the error: java.lang.OutOfMemoryError: Failed to allocate a 1920012 byte allocation with 242424 free bytes and 236KB until OOM Code: Copy Dim EncGIF As AnimatedGifEncoder Dim DecGIF As GifDecoder File.Copy(sourcedir,sourcefile,File.DirInternal,"temp.gif") Log("gif size -> " & File.Size(File.DirInternal,"temp.gif")) DecGIF.Load(File.DirInternal,"temp.gif")'<< original gif path It looks that is occurring because the library tries to load all the frames in the memory. If I had the source code could try to load the frame only when required, reducing a lot the memory use... Does anybody can help?
Erel B4X founder Staff member Licensed User Longtime User Jun 3, 2018 #2 I guess that the problem is that the library loads each frame without scaling it (as done in LoadBitmapSample or LoadBitmapResize). This means that a single frame can consume all available memory. You can try to set the largeHeap in the manifest editor. It will help a bit. Upvote 0
I guess that the problem is that the library loads each frame without scaling it (as done in LoadBitmapSample or LoadBitmapResize). This means that a single frame can consume all available memory. You can try to set the largeHeap in the manifest editor. It will help a bit.