Why is Construct 3 using so much memeory?

1 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • I'm up to 3gb memory usage in the NWjs version of C3 and when I try to save my project, it just crashes after freezing for a bit. My game is an NES style game, so I don't get why my project takes 3gb of memory.

  • Well, that's hard to say. The first thing I'd do is to enlist Chrome to help me find out.

    When you're previewing your project, hit f12 to bring up the developer console. At the top, click on memory. You should see several things listed under 'select javascript VM instance'. Here, you can watch your project's memory usage and chrome will show up and down arrows as it uses more or less memory. You can also confirm here how much memory it's been using.

    If you click on 'take a snapshot' chrome will look through your project and provide you a list of what is using how much memory. A lot of that is going to be difficult to decipher but what you'll be looking for is really large numbers on the right hand side under 'retained size.' If you start expanding out the tree looking at what's consuming the most memory, you may... I say may... be able to recognize some of the data in there and spot the problem.

    You can also select the performance tab at the top, click on the memory checkbox, and record your session. One of the graphs will be of memory and at the top will be screenshots of where you were in the game. If you see a huge spike in the memory, look at the screenshot to see what was happening and that may help you zero in on the problem.

    One other thing to check if you use local storage, select the application tab at the top and then select 'clear storage'. You'll see a pie chart that will tell you how much memory local storage is using.... and guess what, local storage has a huge limit (30gb on my system with 32gb ram). You can browse through the local storage tree below that. Start looking under 'IndexedDB' and look for LOTS of key/value pairs.

    I can say with little doubt that it's likely somewhere in your code and not C3. While I've been writing this, my latest project has been running in the background and it's staying at a pretty solid 42mb.

  • It's Construct 3's editor itself that is using up this memory and causing this issue.

  • Then the steps I outlined above should still help pinpoint the cause.

  • If you run in to a bug or issue in Construct 3, please post it to the GitHub issue tracker here:

    github.com/Scirra/Construct-3-bugs

    You must follow the bug report guidelines or your issue will be closed without investigation.

  • Well, that's hard to say. The first thing I'd do is to enlist Chrome to help me find out.

    When you're previewing your project, hit f12 to bring up the developer console.

    Thanks for the info. Great post!

  • If you run in to a bug or issue in Construct 3, please post it to the GitHub issue tracker here:

    https://github.com/Scirra/Construct-3-bugs

    You must follow the bug report guidelines or your issue will be closed without investigation.

    I don't know if it's a bug or if I'm just doing something wrong.

  • Ashley can I give you my C3P file so you can figure out why it's using three million terabytes of RAM for such a simple game where it has an out of memory error when I try to do anything, despite it's the 64bit version, and tell me if I just messed up or if there's a legit memory leak in C3?

  • Does the problem persist in different browsers/Chrome with no extensions running?

  • Ashley can I give you my C3P file so you can figure out why it's using three million terabytes of RAM for such a simple game where it has an out of memory error when I try to do anything, despite it's the 64bit version, and tell me if I just messed up or if there's a legit memory leak in C3?

    If you run in to a bug or issue in Construct 3, please post it to the GitHub issue tracker here:

    github.com/Scirra/Construct-3-bugs

    You must follow the bug report guidelines or your issue will be closed without investigation.

  • I don't want to post my entire C3P file for the whole world to see and possibly steal because my game has a minorly significant following at this point. I don't know how to recreate the issue with a minimal C3P file. I guess I'll just hope for the best that this gets fixed purely by chance or take my business elsewhere.

  • corlenbelspar - right click the project name in the project bar, and select Tools - View project statistics. What does the "estimated peak memory usage" say?

    If you design a project that uses 3GB of memory, it shouldn't be surprising that Construct uses 3GB of memory. See the blog post remember not to waste your memory for more information.

    If your project is not that big but Construct is still using loads of memory, it might be a memory leak. Such issues are normally rare, but if you can find what is causing it we can try to investigate.

  • Here's the information you requested VS the debugger's memory use. I tried experimenting and it seems the last few layouts I made increase the memory usage by 500mb purely by existing whether I have them open or not. I then tried to make a giant 25600X22400 tilemap object with one tile repeated through the whole tilemap object with the fill tool and then a 2x2 set of tiles repeated and the memory usage shot up like crazy. I'll try to make a bare bones C3P file that demonstrates this and report it, but I still don't even know if this is actual underlying cause or just a symptom of something I'm doing.

    EDIT: Well the image I tried to insert didn't even show, so here I edited it just to link to the image in my Drive.

    https://drive.google.com/open?id=1JK6x-0qp-675uioZTUm5iJpkNCABC22a

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I then tried to make a giant 25600X22400 tilemap object with one tile repeated through the whole tilemap object with the fill tool and then a 2x2 set of tiles repeated and the memory usage shot up like crazy.

    Is that what you have in your project? If the tile size is 2x2, that's something like over 140 million tiles - a truly extreme amount that would push the limits of any engine. The Tilemap object is really not designed to be used at such extremes. So it sounds a lot like you've designed your project wastefully.

  • No I meant I pasted a set of two tiles by two tiles. The tiles are 16x16px.

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