Java heap space,AIR 18 - actionscript-3

I am working on an IOS application, using Flashdevelop and AIR SDK version 18. I got the Java heap space error while compiling the project.
Here is what I have tried:
Modify the jvm.config - I have not tried this, because there is not such file in AIR SDK.
Modify the adt.bat file -Xms1024 -Xmx1024 - I tried it but not working
Modify the mxmlc.bat, but like adt.bat - not working
Any solution? I'll be grateful for any ideas! Please keep in mind I cannot divide the resources and the code - I must pack them together.

Ran across this problem today and wanted to let people know that this can be caused by programmer error...
I had just set up a simple parallax background for my game. It worked fine when the player moved a short distance but I needed to test a long distance. In my game the player moves right automatically until he encounters an enemy so to get him to walk a long distance I simply had to move the enemy further away. I set enemy x to 999999, compiled... and got the Java Heap Space error. I have no idea why that would cause me to run out of memory (I don't really understand how display objects work) but restoring the enemy's position and restarting FlashDevelop fixed the problem.

Related

A/V in delphi application when it is starting

I have an old delphi application.
If i start it outside of ide, runtime error 216 occurs quickly before mainform is shown.
If i start it inside ide, after a few seconds, ide says "too many consecutive exceptions".
I set breakpoints on first lines of initialization sections of all my units. And also add breakpoints of my units' finalization sections. Debugger does not stop on any of them.
When I remove first two units FastMM, FastMM4Messages, it runs inside or outside ide (I know it is not about FastMM4 and FastMM4 is okay).
I set breakpoint at ntdll.KiUserExceptionDispatcher in assembly pane. Now it stops at this breakpoints before any of my units' initialization and finalization.
Any advise ?
I found "FastMM_FullDebugMode.dll" was damaged partially (without change on file modified date or file size). After replaced it with good copy, my problem was solved.

Using Skin for Libgdx in AIDE

Ok, Hi everyone,
I'm kinda new, it's my first post here.. and I started some time ago to develop a game,
I'm still struggeling to make something to work
Stuck in a simple task, loading a Libgdx Skin, I already tried several methods,
such as
Skin skin = new Skin(Gdx.files.internal("....json"),
also tried using atlas and more with the corresponding files but my app refuses to work and still crashes when it comes to skin loading, for now I removed the skin part and came here to ask for an help,
If needed I'll post my code below, or edit this, thanks in advance for any help you could give,
In short story: How to properly load a libgdx skin on AIDE android app? It keeps crashing my app :/
Caused by: com.badlogic.gdx.utils.SerializationException: Error reading file: skin.json
OK, so I just extracted files from libgdx test files, and corrected my path, was telling gdx to search like that: "/.../...JSON", this was a crucial error; correct path should be
".../.../...JSON", sorry for the stupid question ^^
For others as me, verify your paths ;)

AS3 Starling custom shader crash "Error #3600: No valid program set" when computer is locked or put to sleep

I'm working on a Flash game using Starling, and I have started coming across an issue where my render crashes immediately after I put my PC to sleep/lock it and then turn it back on. The error I'm getting is:
Error #3600: No valid program set
I was not able to find any advice online on how to prevent this/re-initialize everything appropriately. I'm assuming this is part of a wider issue with how Flash/Starling handles the computer being put to sleep/locked.
Things I have tried so far:
Catching the error and re-uploading the shader programs.
Setting Starling.handleLostContext to true
Has anyone come across this issue before? Any help/pointers would be greatly appreciated.
It sounds like your game is losing the GPU context.
On context loss, all GPU data is lost. You have to restore textures, vertex buffers, etc. Starling handles some of it for you when you set handleLostContext to true, but you still have to handle the textures.
If you use the AssetManager, it will handle re-uploading textures for you, which is clearly the easiest way to go. It automatically creates a texture.root.onRestore callback function which Starling calls after it re-creates the context, and it will attempt to re-load your textures from wherever you first loaded them from, whether from disk, an embedded asset, or a URL.
You can also manually define the function yourself, though that is more complicated and as the article mentions, some gotchas are involved.
More information: http://wiki.starling-framework.org/manual/context_loss

Invalid BitmapData

So, I'm porting a game, build for web flash in AIR Mobile (using FlashDevelop). Now, I have one class that runs first, which make vector graphic in bitmaps and re-size them as needed. Than, all this bitmaps (actually, BitmapData) are stored in Vectors. This class is a object of a Singelton class, which allows me easy access to the stored BimapData.
Also, I'm using FlashPunk as the game engine.
Now, I already created around 16 BitmapData and stored them in that class and everything is fine. But, the next BitmapData I add, in new Vector object, is not working as it should. Everything is fine while in RenderScreen, but as soon the game starts, e.g. click start game, it should return the BitmapData to create the menu, but it reports "ArgumentError: Error #2015: Invalid BitmapData"
What might be the problem? The BitmapData in question is created from vector graphic using draw(), scaled as needed, with initial width 1024px and height 120px. Also, the game run with around 40Mb memory, so the size is not the problem ...
Any idea why this error shows?
EDIT: I founded the problem and resolve it. How to close this question?
I'd bet my hat that it's a memory problem... error 2015 is either because one of the dimensions are invalid (width or height < 1 ), or because there is not enough memory to create the BitmapData.
The System class has a few properties that might help you debug the state of the memory before you try to create the conflicted BitmapData ;)
And if you find that it is actually a memory problem, besides wearing a new hat, you will have to rethink the way you cache those sprites... try to cache only the necessary pieces for each stage of the application, dispose them before you need to create more, etc. Good luck!

Why am I getting a Stack underflow (error 1024) in release build?

I had this strange problem with stack underflow errors happen only in the release build of Flex Builder project. I looked around the web to find a solution, but while I found some related posts, nothing really helped my out. So here is this question and my solution in the answers so that it may hopefully help other people.
The Problem: I ported a java program (a game) to flex and it works fine in debug mode on Android, the web and Playbook. However, when I build a release version of the game, it crashes. The error reported is 1024, i.e. stack underflow, according to Adobe's documentation.
At first, I thought the problem was limited only to the Playbook, but no, the exact same problem happens at the exact same place on the web browser and Android. From the debugging information I inserted, I discovered that the exception appears to be thrown during the call to another function.
To solve the problem, I broke down the offending function in many individual functions and so narrowed down which precise part of the code what causing problem. This lead me to a few lines of code that had the following call (in a try-catch):
trace(e.getStackTrace())()
Hummm, this apparently was produced by the regex I used to refactor from Java to Actionscript. Removing the extra () solve the problem.
This is the kind of things I wished the compiler would catch instead of letting it fail only at release, when the function containing the offending code is pushed on the stack.