As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!







The 90% Memory Warning

by Jon (Updated on 2015-10-13)

Why does this happen?

The Java runtime reserves a chunk of memory for Stencyl to use before launching -- it can't be raised after the fact. If you exceed this limit, Stencyl locks up.

So why not just set the limit very high? It causes machines with less memory to fail to launch Stencyl at all.

Although we are working to reduce memory usage and plug leaks, there are large games for which having the higher memory usage is useful. This guide explains how you can raise the limit.

Common Misconception: The 90% memory warning has nothing to do with how much RAM your computer has. You could have 128 GB of RAM and still hit this since Java's upper cap sits around 4 GB and on some systems, may be as low as 2 GB.

How to Raise the Memory Limit (Windows)

  1. Install the 64-bit version (x64) of Java 8 to your computer.

  2. Download one of the following scripts and place it into your Stencyl installation directory. (For best results, go lower than what you have -- e.g. If you have 4 GB, choose the 2 or 3 GB option.)

  3. Double-click the script to launch Stencyl from now on.

Note 1: If Stencyl fails to launch, choose a script with a lower amount of memory.

Note 2:Note: The -Xmx setting in the script may be overridden by the _JAVA_OPTIONS environment variable. See this tutorial for how to delete the variable.

How to Raise the Memory Limit (Mac)

  1. Right-click the bundle and pick Show Package Contents.

  2. Using a text editor, open up Contents/MacOS/Stencyl.

  3. Search for -Xmx1536m and change the number to something higher such as 3072 (which would be 3 GB).

  4. Save the file, then relaunch Stencyl. (If your Mac complains that the app is "damaged", go to System Preferences > Security and Privacy and allow apps to be downloaded from Anywhere.)

Note: If Stencyl fails to launch after you make an edit, your number is too high. Try something smaller such as 2048.

How to Raise the Memory Limit (Linux)

  1. Edit the Stencyl shell script.

  2. Change the part that looks like -Xmx1024m to a higher number such as 3072 (which would be 3 GB).

Note: If Stencyl fails to launch after you make an edit, your number is too high. Try something smaller such as 2048 or 3072.

Print Article Edit Article How to Edit an Article
Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!


For Windows users who are wondering how to use these batch files:

Click on the link to one of the batch files -- either 2 GB, 4 GB, 6 GB or 8 GB. When the new tab opens up. Highlight and copy the text. Paste it into Notepad and save it with the extension ".bat". Move that file into the directory that has the Stencyl application in it (usually it's Program Files (x86) -----> Stencyl. After moving it into this directory, double-click the batch file and it should run Stencyl with the correct amount of memory specified in the batch file. You may need to "run as administrator" the first time. I recommend right-clicking the batch file and creating a shortcut on your desktop.

0 6 years, 3 months ago
Total noob here but also running into this issue on Windows 10, Java 8 Update 131 x64. Attempted all the above scripts, none opened the program (had to run Chrome as admin to be able to download to C:\Program Files (x86)\Stencyl), also attempted to Run As Admin.

Happy to send along logs and any other info, and looking forward to any help I can get, super excited to get into Ludum Dare!

0 6 years, 5 months ago
Peter P
1 6 years, 7 months ago
Im really so dissapointed with this and the lack of clear instructions. ive had a couple of games released on android and google play store and this is preventing me from updating or making any more games. i love stencyl as a platform but this and the lack of instructions on how to sort it is terrible. i mean im realy so dissappointed. will be trying to find a new platform now
1 6 years, 9 months ago
I'm running Mac OSX 10.12 (Sierra) and it says 'You can only read' under the sharing and permissions tab in 'get info' even though under the privilege column it says I have read and write permissions. Any ideas? I'm trying to add a 100 kb .png image as a background and I'm getting a storage is full error and then everything freezes. I've tried using Text Edit and Terminal..
1 6 years, 10 months ago
For those on a MAC having trouble editing file, use TEXT EDIT not TERMINAL (which it opens with by default), should be straightforward then.
0 6 years, 11 months ago
Okay, i copied the script in a .bat file and double-clicked on it, but the launch failed.
0 6 years, 11 months ago
It don't work for me : the link in the Windows part don't lead to download.
0 6 years, 11 months ago
... The message still appears...
0 7 years, 2 weeks ago
It took me a little while to figure out, but I got it now.
0 7 years, 2 weeks ago

Sign In to Comment