How to Suppress the 90% Memory Usage Warnings

froz

  • Posts: 250
I'm getting 90% memory usage window from time to time. Not often, usually after I kept Stencyl working for longer time, especially when I test game a lot (usually the window appears when I click "test game" button).

I didn't download the .exe from the article since it's supposed to be installed already (I have 2.1 version).

Is there a way to manually assign Stencyl more RAM? I have 4 GB RAM installed and IIRC Stencyl use not more then 2 GB. I usually have around 30% RAM free when Stencyl complains about 90% memory filled. I guess it could use another 1 GB.

Actually it's not that bad now, but my concern is it will get worse later. Currently my game after publishing weights only 800 KB. The problem is that if I have to restart Stencyl I have to open all tabs manually + sometimes after restarting I can forget what exactly I was trying to do, in which behaviour etc.

Hope you can help me. Thanks.

Joe

  • *
  • Posts: 2480
You can launch Stencyl from the command line and increase "1024" in "-Xmx1024m" to something larger:

java -Xms64m -Xmx1024m -Djava.library.path=lib -jar sw.jar -Duser.home=%USERPROFILE%

abuki

  • Posts: 84
This worked perfectly for me! I also made a .bat file for easier launch (just added java -Xms64m -Xmx4096m -Djava.library.path=lib -jar sw.jar -Duser.home=%USERPROFILE% to txt file and changed .txt to .bat and this file must be in stencyl folder)

Also I had to install java runtime and set PATH global variable in windows system. It is better to install also the 64bit version of Java, so you can increase the memory as you want, not only to 1280mb which was with 32bit version (unless it did not launch Stencyl).

Before that Stencyl was unusable for me - always got error during swf export, that file cannot be exported and that I should check sound. Maybe it would be fine to write there, that there can be also memory problem, because for me it was always memory problem.
twitter: @abukac http://www.circusatos.com

MyAppyKid

  • Posts: 66
This is brilliant! Thanks a ton - I was having serious limit issues with what I was able to do, but now making the .bat file made my game run smoothly! Thanks x100

MyAppyKid

  • Posts: 66
Can this type of work around be done on a mac?


codemagic

  • Posts: 14
maybe you want to change the text on the "the 90% warning" page for windows user because it was a complete waste of time to read. it only says it should work if i have latest version, yeah, but it doesn't that's why i'm reading in the forums...

my solution for win:
download and install java x86/x64 (> 2GB)
set path variable for java
make bat file and copy it to stencyl folder

Islington

  • Posts: 6
Hi! I have the same issue with 90% memory usage warning while trying to upload my .png file to the background. I've made all the steps suggested by Joe, abuki, and codemagic - installed latest java, created .bat file with the code above, set path variable for java, but .bat file only works with 1024m, neither 2048 nor 4096 are working. Do you have any ideas what could be the cause of the problem?

i'm using windows 7, RAM: 4 GB, system type: 64bit. .png file is about 200mb and 4000x8000 pixels.

Your help will be highly appreciated!

Thank you in advance!

« Last Edit: November 24, 2012, 09:21:44 am by Islington »

Joe

  • *
  • Posts: 2480
What do you mean that it doesn't work with anything but 1024m? Does Stencyl not start? Which version of Stencyl are you using?

Islington

  • Posts: 6
yes, it doesn't start when it's anything but 1024m in my code. cmd.exe opens for a second and then disappears and nothing happerns. Stencyl's version is 2.2.0 (b502). Thanks!

Joe

  • *
  • Posts: 2480
Try running cmd.exe first by itself and then type in those lines. The command window won't disappear that way.

Islington

  • Posts: 6
Hi again, i tried to do what you advised, below is the error that i got. Am i doing something wrong? i believe i should specify sw.jar's location, but i have no clue how to make it in cmd.exe when it's running by itself. Sorry to bother you with this, but i am completely ignorant when it comes to programming. Thank again! :)

C:\Users\Bel>java -Xms64m -Xmx2048m -Djava.library.path=lib -jar sw.jar -Duser.home=%Bel%
Error: Unable to access jarfile sw.jar

C:\Users\Bel>

Joe

  • *
  • Posts: 2480
Click on the Start Button, type "cmd", and press Enter when "cmd.exe" shows up in your search results.

Islington

  • Posts: 6
i already opened it, the error message i've copied above is what i got. Please see picture attached. above one is when i just opened cmd.exe from start button and second one is after coping the code line.

Joe

  • *
  • Posts: 2480
Ah, okay. Step 1 is to "cd" into your installation directory. It's probably something like this:

cd "C:\Program Files (x86)\Stencyl" <press Enter>

Then do the Java line.