[mono-android] The program 'Mono' has exited with code 255 (0xff).

Amir Waldman amirw2k at gmail.com
Sat Mar 26 16:46:59 EDT 2011


Lately, I've started testing my code and I'm seeing Mono for Android
crashing too many times without a warning.

Scenario: I click on buttons many times till the application crashes. No
exception is caught!

Visual Studio's Output window shows:
In mgmain JNI_OnLoad
...
The program 'Mono' has exited with code 255 (0xff).



While trying to locate the so called bugs in the '...' lines that I removed,
I couldn't find anything wrong. There are many calls that change properties
of objects stored in memory.

Can you try and help what is wrong here?

1) The code is dynamically removing and adding Android views to the same
activity (is that wrong in Mono/Android terms?)
2) The code changes many 'Text' properties of C# objects stored in memory.
This for example is a result of translating them to another language after
they've been loaded.

To sums things up, I get the feeling that I'm either doing something
generally wrong (for example, working extensively with one Activity), or
there's some instability with the way Mono for Android handles memory.

One last thing, I'm running the same code on a PC and everything works
perfectly well. I checked Android's CPU and memory usage before this
happens. CPU is not stressed at all, and memory usage is about 25MB which on
my device reached up to 50MB without crashing before.

Samsung Galaxy S , Preview 14.

Thank you for your comments!

Amir



More information about the Monodroid mailing list