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 / [paul] Clean up / residual problem on low spec systems?

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 18th Jun 2013 20:45
I have found another issue which is causing problems on low spec PCs (e.g. laptops with built in / shared memory graphics devices).

If you overload the allocated memory (e.g. with several hundred or thousands of sprites), whilst it will be OK that time with smooth FPS, you can sometimes close the game and the game has an exit fault (appcrash).

Subsequent running the game again gives very stuttery and torn screen update which can't be fixed unless you either reboot machine or flush out video card e.g. change desktop resolution a couple of times.

Game works properly again one more time, then back to stutter / screen tear after exit (and appcrash).

I added a proper quit function for clean exit which includes deleteallsprites() and deleteallimages() and problem appears to have gone when I do this.

Is there any way to expose some commands for initialising video memory or flushing GPU ? Perhaps

I am testing on an i3 laptop which has plenty of CPU for the job, but the GPU is intel(HD) graphics with "only" 512Kb memory. Would be nice to pin down what causes the behaviour as I can't really only specify high spec graphics cards for relatively simple 2D games.

There must be something not right with the auto-cleanup / deallocation of sprites of other things sent to the GPU. In some tests I did, it seemed to be around the 8192 sprites count (not necessarily drawn sprites either - I think I was only drawing about 300-400 sprites at the time).

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 18th Jun 2013 23:36
This is something that appeared with the intel ultrabook updates i belive?

Something we have to live with until they solve it.

I ususally delete all media manually and only use delete all to reset the auto ids.

There is no method then the delete all to reset these.

If it whas an easy solution so would it have bin solved by now.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 19th Jun 2013 21:41
Is it on any fix list?

I should correct my earlier post as the video adapter in this laptop only has 128Mb of RAM and will use shared memory otherwise.
Surely this has to be the issue?

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 19th Jun 2013 23:58
I dont know if this would fix anything ?
But maybe agk apps could flush memory at start up and exit as an safety ?
I belive paul is the one to answer this?
But it could be an temporary solution?
But i trust in Pauls knowledge on this

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Jun 2013 00:09
You know, I'd even settle for a GPU check I could use to see if the game will work. Hopefully Paul will respond soon enough

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 20th Jun 2013 18:55
The GPU memory cannot manually be cleared by an app, we close the OpenGL context at the end of an app and the OS or graphics driver takes care of the rest. Are there any graphics driver updates for your machine?
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Jun 2013 19:51
There are no updated drivers - this is the latest.
I also used OpenGL extension viewer and accordingly the card was 100% ogl2.0 compatible.

The capability report may shed some light:



perhaps you recognise something in there that seems insufficient?

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Jun 2013 20:28
Quote: "The GPU memory cannot manually be cleared by an app, we close the OpenGL context at the end of an app and the OS or graphics driver takes care of the rest. Are there any graphics driver updates for your machine? "

I know you can trick ios to clear objects marked as garbage.
Exactly as you state so cant you really clear it with an app manually but there seam to be some tricks out there.

I found this in an Adobe forum about ios apps.

i have been facing the same problem, and BitmapData.dispose() is a good solution the remove the data from memory, but the problem still is the garbage collection. The data is still in memory, because it only gets flushed when the garbage collection occurs. The garbage collection only gets triggerd when iOS detects a "low memory warning" (you can monitor that using the instuments program that comes with the xcode development software)


The solution for this is manually trigger the garbage cycle by calling System.gc() , this triggers the garbage collection, and removes everything from memory that has been flaged for garbage collection.


Would this help somehow?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Jun 2013 22:10
This sounds similar to the way .net garbage collection works (only you can't force .net to garbage collect)

I've resigned myself to trying timer based movement now, as it's probably the right thing to do anyway.

There are low level ways to clear gpu data, but perhaps not via openGL.

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 21st Jun 2013 00:22
Unfortunately, Intel graphics is is widespread now, and in my experience with many thousands of institutional computers is total s***e.

If the laptop is using shared memory, it's likely that that's not being properly freed by the OGL drivers.

I've used and programmed garbage collectors, and they can be wonderful, but I still ensure that everything I create is deleted and the pointers nulled before a context switch. Don't trust anything that's out of your control.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 21st Jun 2013 07:20
I am switching over to timer based movement (can toggle to vblank mode as well), but need to go over all my code adjusting movement routines.

I have found the "crash/freeze on exit" has gone away as part of this exercise too.

Login to post a reply

Server time is: 2024-04-28 04:58:41
Your offset time is: 2024-04-28 04:58:41