Out of Memory Exception
#1
Posted 09 July 2012 - 03:15 PM
I'm working on a game which is a bit high on art. Currently the Windows zip or Android apk build is about 23MB is size, it seems to build and play properly. When I add a few more levels and art, and try to compile a preview or application file, I get an 'OutofMemory Exception' error msg. It seems to happen during the 'TPAGE' creation stage. I have attached a snapshot of the error message.
Could someone please guide.
Thanks.
Sh.
--------------------------------------------------------------------------
(Could not attach the image, hence have typed the first few lines below)
Exception:
System.OutOfMemoryException: Out of memory.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Rectangle scrRect, GraphicsUnit srcUnit)
at GMAssetCompiler.TexturePage.Scale(Bitmap Bitmap, Int32 scaleWidth, Int32 scaleHeight)
at GMAssetCompiler.TexturePage.AddImage(Bitmap _image, Boolean _pack, Boolean _ignoreTextureScale)
at GMAssetCompiler.IFFSaver.<WriteSprites>b__7(KeyValuePair'2 _kvp, Stream __s, IFF __iff, Int64 __index)
.....
--------------------------------------------------------------------------
#2
Posted 09 July 2012 - 03:30 PM
#3
Posted 09 July 2012 - 03:53 PM
I had this issue as well. I was using more than 150 background images, with an average size of 1500 x 450. Studio cannot handle that many files with that size. It has something to do with texture pages and its memory consumption. I tried several methods but didn't work for me. Try using a larger texture page size. Try reducing the size of your art or split it in sections to fit nicely within the 512 / 1024 texture page size.
#4
Posted 09 July 2012 - 05:40 PM
When was the last time you shut your pc down and restarted? Every time someone posts this error, they reboot and they do not see it again. Just a suggestion.
Thanks David. Tried your suggestion. Seemed to work the first time post restart, built for Android. Post this when I tried compiling for the PC, gave the same error. Tried restarting a couple more times, doesn't seem to work. Even in the past, this error has shown and then disappeared, maybe when I restarted.
When you say high art, what are the width x height dimensions?
I had this issue as well. I was using more than 150 background images, with an average size of 1500 x 450. Studio cannot handle that many files with that size. It has something to do with texture pages and its memory consumption. I tried several methods but didn't work for me. Try using a larger texture page size. Try reducing the size of your art or split it in sections to fit nicely within the 512 / 1024 texture page size.
Thanks Titus. Am currently using around 100 images (sprites + bg). Of which around 30 are large (1024x768 or 1440x768). The rest are smaller sprites, below 128x128.
Have faced this issue in the past as well. Seemed to go away on its own, probably when I restarted the system.
It seems to happen during the Texture Page creation process. Was wondering if this is an issue that can be sorted in the next version of GM.
#5
Posted 10 July 2012 - 02:17 PM
Post adding the new level textures, I deleted a couple of redundant ones that I found. GM seems to build now..
Does anyone know how exactly TPAGE creation gets done. Why does it run out of memory. Is there anything that can be done to solve or get over this issue, for instance will grouping of textures into sets help. Sizing textures down or slicing them up I realise might help. Though with slicing, they would need to be grouped into many sets, to ensure the sliced pieces don't end up in different texture pages and thereby increase texture swaps while playing the game.
My game as mentioned is a bit heavy on art, will a lot of unique backgrounds and sprites.
Thanks.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











