Memory Management

  ... discussions about development with the GLES2 branch of AndEngine.

Re: Memory Management

Postby e.r. » Mon Jun 17, 2013 3:17 am

@nazgee,
yeah indeed the code is nowhere near from being used in an app, just wanted to make the idea of the heap more clear. And since I use solely png I tested it on it just as a POC :)

Any idea on the setText allocations?
User avatar
e.r.
 
Posts: 557
Joined: Sun Sep 09, 2012 1:41 pm

Re: Memory Management

Postby Mathew » Mon Jun 17, 2013 6:28 pm

Someone once shared displaying changeable text features (it was designed for score, but could be re-written little bit) that does not invoke GC. Search features section.

Edit, found it, it has been shared by tajny - Here.
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: Memory Management

Postby e.r. » Mon Jun 17, 2013 7:18 pm

Mathew wrote:Someone once shared displaying changeable text features (it was designed for score, but could be re-written little bit) that does not invoke GC. Search features section.

Edit, found it, it has been shared by tajny - Here.

Thanks !
User avatar
e.r.
 
Posts: 557
Joined: Sun Sep 09, 2012 1:41 pm

Re: Memory Management

Postby Mathew » Wed Jun 19, 2013 7:34 pm

I found it useful while looking for leaks, to perform stress test of my game, by making timer which is responsible for continuous restarting of my game (restarting level) while analysing heap status, managed to restart more than 10.000 times so I believe all major leaks are now fixed, though allocated heap has grown little bit by few 0.00X% but what`s really important, heap size was kept on the same size)
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: Memory Management

Postby Mathew » Wed Jun 19, 2013 7:56 pm

Funny thing: on really low hardware device with my game, where on beginning before stress test I had 30 FPS, after performing 20.000 restarts.. fps raised to ~50-55.. and game was noticeable smoother, but it has to be for sure my mistake somewhere.
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: Memory Management

Postby RealMayo » Wed Jun 19, 2013 8:07 pm

Sounds like you should make a loading screen that behind the scenes restarts your game 20,000 times and then finally allows the user to start playing :lol:
User avatar
RealMayo
 
Posts: 1694
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Memory Management

Postby Mathew » Wed Jun 19, 2013 8:28 pm

RealMayo wrote:Sounds like you should make a loading screen that behind the scenes restarts your game 20,000 times and then finally allows the user to start playing :lol:


Well unfortunately it was only silly mistake in code : )
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: Memory Management

Postby RealMayo » Wed Jun 19, 2013 8:35 pm

I'm curious what that mistake in code was. It might be educational for us to know what happened, so that we can make sure we don't make that same mistake.
User avatar
RealMayo
 
Posts: 1694
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Memory Management

Postby RealMayo » Fri Jun 21, 2013 4:16 pm

Btw this is awesome... you can detect the manufacturer, model, api, etc of a user's phone at run time. I'm totally going to incorporate this into the support email template that users send me when they need help in my game...
http://stackoverflow.com/questions/3213205/how-to-detect-system-information-like-os-or-device-type
User avatar
RealMayo
 
Posts: 1694
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Memory Management

Postby e.r. » Fri Jun 21, 2013 11:13 pm

This is good info thanks for sharing, one question though should this raise any privacy concern? I mean collecting hardware information from the user device. (curious Q )
User avatar
e.r.
 
Posts: 557
Joined: Sun Sep 09, 2012 1:41 pm

PreviousNext

Return to GLES2

Who is online

Users browsing this forum: Google [Bot] and 104 guests