Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Has anyone came across this memory error in the logcat?

Author
Message
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 8th Aug 2014 11:21
I'm playing my game on my device and after about 10 minutes of gameplay the app just crashes.
My device is a galaxy S3.

The error is:
Quote: "
08-08 01:09:23.688: E/native-activity(30281): Failed to get HTTP response ready, HTTP ID 10003 does not exist

08-08 01:09:32.267: W/Adreno-GSL(30281): <gsl_ldd_control:393>: ioctl fd 65 code 0xc01c0934 (IOCTL_KGSL_GPUMEM_ALLOC_ID) failed: errno 12 Out of memory
08-08 01:09:32.267: E/Adreno-GSL(30281): <ioctl_kgsl_sharedmem_alloc:1524>: ioctl_kgsl_sharedmem_alloc: FATAL ERROR : (null)
"


Has anyone every had this error happen and what did you do to get rid of it?

Prove Your Worthiness
KG2Entertainment.com
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 8th Aug 2014 12:45
It's a GPU fault, so are you accidentally loading loads of imagery and not deleting it?

-- Jim - When is there going to be a release?
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 8th Aug 2014 20:27 Edited at: 8th Aug 2014 20:28
Ok. The background stays loaded for the life of the program. But I don't attempt to load that again. That image is 864 x 1156.

There are small graphics that I keep in memory but they don't take up no more than a couple of megs of memory.

I will look over the program again, but as far as I can see, most graphics are deleted and not loaded until they are needed.

On another note, how does video memory work exactly? Let's say an image is 864 x 1156 but it's 360KB in size. How does the gpu handle that image.

Does the GPU use more memory than the size of the image to keep it stored?

Prove Your Worthiness
KG2Entertainment.com
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 8th Aug 2014 20:46
Quote: "On another note, how does video memory work exactly? Let's say an image is 864 x 1156 but it's 360KB in size. How does the gpu handle that image.

Does the GPU use more memory than the size of the image to keep it stored?
"


Depends on the device. It's not uncommon for textures to be rounded up to the nearest power of 2 though. So it's a good idea to assume the surfaces will have a larger 'in memory' footprint than you've supplied.

ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 8th Aug 2014 21:31 Edited at: 8th Aug 2014 22:51
Quote: "Depends on the device. It\'s not uncommon for textures to be rounded up to the nearest power of 2 though. So it\'s a good idea to assume the surfaces will have a larger \'in memory\' footprint than you\'ve supplied."


So if my device is rounding up, then is it possible the footprint could be 1024x1024 for my 864x1156 image? Am I understanding it right?

AGK actually has info on this:
http://www.appgamekit.com/documentation/tips.html#1024size

I forgot that this was here. Looks like I have to redo my graphics. I have a lot of uncommon graphic sizes. I didn\'t follow the power of 2 at all. The sizes I have is 864x1165, 995x1300, 274x36.

Live and Learn I guess.


@EDIT
After reading the AppGameKit Documentation, I found my problem.
Quote: "On mobile devices images must be a power of 2 in size, this means a size of 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, or 1024, for example 256x1024 is a valid image size. When you load an image in AppGameKit that is not a valid size AppGameKit creates a valid sized image that is big enough to hold your image and copies your image onto it. This wastes memory as the 320x480 image you loaded will be placed on a 512x512 image surrounded by black pixels that will never be used (you can use atlas textures to get around this). It also means you can\'t use UV scrolling as the black pixels are now part of the image and will appear when you try to modify the UV coordinates."


Prove Your Worthiness
KG2Entertainment.com
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 8th Aug 2014 23:05
OK. Now that I have found out what I have been wrong. My next question is, when I release a pic from memory that went into a 1024x1024 image size, does it get release right then or do the program have to wait for the garbage collection to take place?

Prove Your Worthiness
KG2Entertainment.com
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 9th Aug 2014 00:06
Garbage collectors come, like ice-cream, in many flavours. But they should all release when a new allocation passes the trigger threshold.

Only Paul knows whether the cache is flushed or not.

-- Jim - When is there going to be a release?
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 9th Aug 2014 10:00
Quote: "I didn\'t follow the power of 2 at all."


Powers of 2 are used as arbitrary texture sizes require multiples to compute each (U/V) location on the texture. But when the surface width is a nice even power of 2 though, the render routines can replace the mults with arithmetic shifts, which is a lot faster.

ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 9th Aug 2014 10:29 Edited at: 9th Aug 2014 10:30
Thanks for your responses guys!
I'm trying to get my head around this stuff. It's new to me.

I'm a desktop applications developer trying to get into game programming, so forgive me if I say I don't quite understand some of what you post. But I'm learning.

The one thing about me is that I'm able to do things and get apps made like 'Prove Your Worthiness', mainly because of the ease of AGK; but as I'm trying to add more to the app; I'm running into issues due to lack of understanding and knowledge.

@Kevin
So would you be so kind to explain what you mean a little bit more:
Quote: "Powers of 2 are used as arbitrary texture sizes require multiples to compute each (U/V) location on the texture. But when the surface width is a nice even power of 2 though, the render routines can replace the mults with arithmetic shifts, which is a lot faster."


Prove Your Worthiness
KG2Entertainment.com
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 9th Aug 2014 11:07
Here's a simplification of the calculation that is being done for each colour grabbed from a texture. The best analogy I can think of AGK/DB terms is using the Memblocks to drawn/create textures.




Login to post a reply

Server time is: 2024-05-13 10:53:59
Your offset time is: 2024-05-13 10:53:59