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 / memory loss between loading and unloading

Author
Message
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 29th Jan 2013 17:42
Hi everyone,

I am learning how the memory is used with AGK. I don't understand it, I can't free all the memory...
For example, you use 20Mb of RAM, when you run your app. if you load a video (we will suppose 10 Mb) and then you remove the video... the memory should be 20 Mb, however the memory is 24 Mb.
if you load 10 images (512x512) and create 10 sprites and then you remove the sprites, you get 24 Mb again.
If you load and remove the video and create and remove the sprites, you get 30 Mb.

Why?
How can I free the memory?

Thanks!
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 29th Jan 2013 17:54
OK... in sprites doesn't have problem if you load the image and then you create the sprite (if you use createsprite(loadimage()), then you have problems)...

But, how can you recover the memory after load a video?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 29th Jan 2013 18:01
It sounds like a bug possibly, although I have not used the new video commands yet as I still use 1076. Are you deleting both the image and sprite data?

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jan 2013 18:21
Juande, what version of AppGameKit are you using and are you working in Tier 1 or Tier 2?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 29th Jan 2013 18:28 Edited at: 29th Jan 2013 18:28
Quote: "in Tier 1 or Tier 2?"


Quote: "createsprite(loadimage())"


I suppose T1. Not judging here, though.

Follow me on twitter! @MotionStruct
Motion Struct blog
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 29th Jan 2013 18:32 Edited at: 29th Jan 2013 18:32
Thanks for your answers!

DVader, I use this method for create the sprites "Createsprite(1,loadimage"a.png")". I thought that with this method, when you was removing the sprite, you was removing the image. I have checked that This is not correct.

Ancient Lady, The version is 108, beta 8. I use T1

My code is


Thanks!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jan 2013 18:40
Yup, I should have spotted that. Tier 1 it is.

The AppGameKit version is v1082 or better.

Restoring memory after a DeleteVideo() is called should happen automagically.

If it isn't, that is a bug and should be reported in the Google Issue list with a suitable code sample to show the problem (and maybe the video you are trying to use).

Juande, if you are not using the latest v108 version (v1088), try that and see if it helps (they are still working on the video commands).

Also, what platform are you seeing this on and how are you determining the memory usage?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jan 2013 18:48
We crossed posts!

Okay, you should probably have a Sync() command in your while loop, just to make sure things update properly. But that should not affect the failure to release memory.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 29th Jan 2013 19:37
Yes... I have a sync() command...
I am testing in windows and I am watching the memory with taskmgr.
I have a problem with the mp4 files in windows (Failed to load video file because i don't have the mp4 filter) and so, I can only load wmv files in windows.
I have loaded other file wmv and it's the same... my results are

app running: 20Mb
load first video file (first test video): 30 Mb
delete first video file:24 Mb
load second video file (second test video): 35Mb
delete second video file:24 mb

Perhaps, Does directshow use 4 mb?

Thanks
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jan 2013 20:02
I would expect that the 4MB is for various support things needed for the video display. Once you load the first video, the things needed to monitor the video status are instantiated (this is all my guessing, not anything official). And, having started one video, the pieces stick around in case you do another.

If that is all that is getting left over, I wouldn't sweat it.

If you leave the app up after the second video delete and walk away for 15 minutes or so, does the memory usage change?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Juande
13
Years of Service
User Offline
Joined: 2nd Sep 2011
Location:
Posted: 30th Jan 2013 19:34
Nop, the memory usage is the same.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Jan 2013 19:38
Oh well. Than it is just something to be lived with. It doesn't get worse each time you load and delete, so it is not a creeping issue.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 09:01:52
Your offset time is: 2024-11-24 09:01:52