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 / [Tier 2] - AGK 2 is not releasing memory.

Author
Message
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 8th Feb 2015 15:09 Edited at: 10th Feb 2015 04:02
I'm using the latest release(2.0.11) and AppGameKit is not releasing memory.

I'm loading an image that is 640x960 which takes up 4mb of video memory; I see the memory go up exactly 4 mb using the task manager but when I release the memory nothing happens.
I'm using Visual Studio 2008.

So what am I not understanding????


Here is code wrapping the AppGameKit commands in a class:



Here is the code without wrapping with the same results:


Prove Your Worthiness
KG2Entertainment.com
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Feb 2015 17:31
It frees the memory here, although I think when an image is deleted it is up to the OpenGL driver whether it is actually removed from memory straight away or left there until it needs the space.
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 11th Feb 2015 17:45 Edited at: 11th Feb 2015 19:34
OK. That makes sense, but I think that is causing me problems in my project because it seems that my app is crashing because of memory issues before it has a chance to clean up things.

Edit:

I think I know what going on now. My heap is getting too large that the Android OS is killing the app.

I have an array of objects that I instantiate with the new command (level select images from 1 to 36 - page 1), and when I am finished with it I delete those objects but soon after that I instantiate it again with new objects that fill up that array. (these are my level select images from 37 to 72 - page 2), because I swiped to bring up the next set.

Well with the new command it allocates more memory, and it hasn't had a chance to free up the previous set. So it seems like there is an increase in memory every time. So it seems I'm stuck to when OpenGL decides to free up the previous memory. I think that is correct.

Prove Your Worthiness
KG2Entertainment.com
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 12th Feb 2015 00:16
Quote: "Well with the new command it allocates more memory, and it hasn't had a chance to free up the previous set"


I would be very surprised if this was the reason. It is more likely something you are doing wrong I would think.

It would be very difficult to make any type of high memory use application if memory was not freed and reused properly behind the scenes. Hopefully someone with more knowledge on this can clear it up, for now though I would double and triple check your code

ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 12th Feb 2015 09:25
Quote: "I would be very surprised if this was the reason. It is more likely something you are doing wrong I would think.

It would be very difficult to make any type of high memory use application if memory was not freed and reused properly behind the scenes. Hopefully someone with more knowledge on this can clear it up, for now though I would double and triple check your code
"


Yeah, I'm checking the code. I'm also reading up on memory management because I thought I had a good understanding of it but I guess I don't.

Prove Your Worthiness
KG2Entertainment.com

Login to post a reply

Server time is: 2024-11-25 16:40:55
Your offset time is: 2024-11-25 16:40:55