Debug RAM Usage For Arrays?

0 favourites
  • 5 posts
  • Hi,

    I'm trying to debug the RAM usage for the Arrays that I use in my game as they are quite big in size, around (14mb+)Compressed Each. But Construct shows Ram usage just for images.

    Is there any way to know how much Ram uses an Array?

    I try to use Chrome "Task Manager" but it gives a few different values like (Memory FootPrint & JavaScript Memory) and not sure if any of those are the ones that I should look for or if they are any accurate.

    Thank you

    These are some of the pictures from Chrome TaskManger:

    Empty Project but No Json Loade yet:

    Empty Project + 1 JSON Loaded of 14mb size

    Empty Project + 2 JSON Loaded of 14mb size each

    Empty Project + 3 JSON Loaded of 14mb size each

    Tagged:

  • Also will be nice to have some kind of Construct expression that gives the percentage while it's loading any Arrays so we can add some loading screen showing percentage as we do with the "loadingprogress" at the start of the Game which gives a value between (0 To 1) as sometimes takes several seconds to load each Array if they are big. This way at least we can show the loading progress for feedback instead of nothing.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I take it as it's not possible to debug the size of the Arrays in the Memory to fix my crashing issues due to the Arrays being big. I will have to keep guessing instead (:

  • I believe array object is essentially a Javascript array, so you can estimate its memory usage:

    mattzeunert.com/2016/07/24/javascript-array-object-sizes.html

    This way at least we can show the loading progress for feedback instead of nothing.

    I actually stopped using loadingprogress expression, as it often doesn't refresh. Instead I'm showing a fake progress counter, something like this:

    Every random(1,2) seconds
    Progress set to min(100, progress+choose(0,1,2,3))
    Text set text "Loading ..." & Progress & "%"
    
  • I believe array object is essentially a Javascript array, so you can estimate its memory usage:

    https://www.mattzeunert.com/2016/07/24/javascript-array-object-sizes.html

    > This way at least we can show the loading progress for feedback instead of nothing.

    I actually stopped using loadingprogress expression, as it often doesn't refresh. Instead I'm showing a fake progress counter, something like this:

    > Every random(1,2) seconds
    Progress set to min(100, progress+choose(0,1,2,3))
    Text set text "Loading ..." & Progress & "%"
    

    Thanks a lot dop2000 I will have a look at it, hopefully with that will be able to estimate the size

    Instead I'm showing a fake progress counter, something like this:

    Hoh yeah that's exactly what I did, I faked the loading and added some timers etc... not bad for a workaround

    Thanks again ))

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)