Reduced Memory Usage

Jon

  • *
  • Posts: 17524
Just a shout out to say that reduced memory usage is one of the areas we're addressing in StencylWorks 2.0, so that the 90% memory usage messages are a thing of the past.

It's a large undertaking, and we realistically won't plug every single memory leak or overage in the app, but as I like to say, if we can rid of 80% of it with a reasonable effort, I think that will go a long way towards improving things for everybody.

The nightly builds will begin to roll this out in parts, and we'll announce when we're at a good spot to get some of the public's eyes on this.

JamesGames

  • Posts: 15
I'll miss the message a little bit, actually...it has been my only indicator that time is passing on more than one occasion. Still, my heart will go on.

rob1221

  • *
  • Posts: 9424
Yes please, having to restart while in the middle of something is very annoying.

RayonMazter

  • Posts: 123
Great news, can't wait!

1MrPaul1

  • *
  • Posts: 1268
Good news! Your last improvemens in design mode was very helpfull, i mean working with large behaviors, it helps make behaviors more complex and more clever. Small thing with big effect. And can't wait for this new fix. I hope it will help to work in the same time with stencylwork and with photoshop. Now I usually work or with coding in SW or with graphics in photoshop, because both applications use memory very active.

Legendary Hoamaru

  • *
  • Posts: 1088
A lot of memory leaks have been plugged in the Nightly Build.  You can help speed up the process and catch any bugs that may appear by testing it here:

Nightly Build

I'd recommend backing up game files before using this build.

How/What to test

All resource editors have had memory leaks plugged.  What you want to search for are permanent increases in memory after you open and close a resource. 

To test for memory leaks, you need to grab the Resource Monitor extension from forge.  When testing for memory leaks wait for about 20 seconds and then click the trash can a few times before reporting results. GC is very lazy, and only really GCs out of necessity unless you force it. Unlike previous versions reaching the 90% limit doesn't mean you have to close SW as (most) objects are actually cleared out when resources are closed.  If your game has a lot of resources or you open a lot of resources, you'll hit the 90% mark but probably aren't experiencing memory leaks (we'll have a way to increase max memory down the line).

Also, ignore the results of the first "run".  Meaning, there may be a small increase in memory the first time you close a certain resource or perform an action since classes not in use before are loaded for the first time.

If you suspect a memory leak:

Please post used/reserve numbers for the these:

* Before you open a resource.
* After opening x amount of resources
* After closing all of the resources

Areas that are known to still leak:

Dialogs in the Game Center (Such as Create New, Game Properties).

Thanks for the help!


« Last Edit: December 27, 2011, 12:40:09 pm by Legendary Hoamaru »

Darkhog

  • Posts: 1243
Thanks! Although it never happened to me, I'm sure it might happen for other people with less RAM. I already know how memory leaks in Java are hard to close since I got one in JNotepad and wasn't able to fix it (though I know cause, just ain't able to fix it).

I really appreciate your effort to make our lives better.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Rob

  • *
  • Posts: 1268
I only see Resource Monitor under forge extension (not Memory Analyzer). Is that what you mean?
GOLDEN RULE #1 : SAVE YOUR GAMES FREQUENTLY
IOS/XCODE DEBUGGING
http://www.stencyl.com/help/view/xcode-ios-troubleshoot/
WATCH STENCYLWORKS VIDEO TUTORIAL BY SUNRISEKINGDOM
http://www.youtube.com/watch?v=KDfRfjzr9j4&feature=channel_video_title

Legendary Hoamaru

  • *
  • Posts: 1088
Yep, thanks! Editing now.

Rob

  • *
  • Posts: 1268
Thanks. I also like to know exactly what are the 3 numbers in the resource monitor. An example is 21MB/62MB (495MB). The first 2 will start to change once I open a new game and open a new behavior within the game to say 57MB/98MB (495MB). Then they will keep changing as I open more behavior.

In general, I see the first number go up as more behaviors are opened and will drop back when I close the game. The second number will continue to rise (in some increments) once new behavior are opened and will not drop even if I close the game. The third number always stays at 495MB for me.
GOLDEN RULE #1 : SAVE YOUR GAMES FREQUENTLY
IOS/XCODE DEBUGGING
http://www.stencyl.com/help/view/xcode-ios-troubleshoot/
WATCH STENCYLWORKS VIDEO TUTORIAL BY SUNRISEKINGDOM
http://www.youtube.com/watch?v=KDfRfjzr9j4&feature=channel_video_title

Alexin

  • *
  • Posts: 3132
The first number tells the memory currently in use. The second refers to the amount of memory committed to the application. The third is the maximum amount of memory the application can ever have.

used <= committed <= max
"Find the fun"
alexin@stencyl.com

Rob

  • *
  • Posts: 1268
Thanks Alexin. I hope more people can help and test it out. Basically, I think we should look for the used memory (field number 1 in resource monitor extension) would not increase overtime (it may spike temporarily) after we open game, open and close behaviors/resources and close games etc. Also, we should expect to see nothing functionally breaking with this build.
GOLDEN RULE #1 : SAVE YOUR GAMES FREQUENTLY
IOS/XCODE DEBUGGING
http://www.stencyl.com/help/view/xcode-ios-troubleshoot/
WATCH STENCYLWORKS VIDEO TUTORIAL BY SUNRISEKINGDOM
http://www.youtube.com/watch?v=KDfRfjzr9j4&feature=channel_video_title