|
Forum Index : Microcontroller and PC projects : Is there a way to manage Heap size?
| Author | Message | ||||
| RCMAN Newbie Joined: 31/10/2020 Location: CanadaPosts: 29 |
I'm reading large sprites and getting the error "Not enough heap memory" I looked up an option for it and didn't find one. Can I increase it? Thanks RC |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10590 |
No The issue is in the decoding of PNG files which use huge amounts of memory. One workaround is to convert large png to bmp read these into memory and then use sprite read to convert the image into a sprite The other thing you can do is make sure you load sprites before setting up any array or string variables Edited 2020-12-10 02:18 by matherp |
||||
| RCMAN Newbie Joined: 31/10/2020 Location: CanadaPosts: 29 |
I converted to BMP and still getting the error. for i = 1 to 59 ' load bmp "00"+str$(i) if i < 10 then load bmp "gfx/000"+str$(i)+".bmp" ' blit 0,0,0,256,256,256,1 'print "000"+str$(i)+".bmp" sprite read i,0,0,256,256,1 else load bmp "gfx/00"+str$(i)+".bmp" ' blit 0,0,0,256,256,256,1 sprite read i,0,0,256,256,1 'print "00"+str$(i) sprite show i,100,100,0 gfx.zip end if Attached the images RC |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10590 |
You are simply trying to load too much data Assume 8-bit colour mode 256x256 = 64k *2 (original image + screen save) = 128k *59 = 7552K = 7M Available memory 5M |
||||
| RCMAN Newbie Joined: 31/10/2020 Location: CanadaPosts: 29 |
Okay thanks. I'll make them smaller :) Thanks RC |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |