Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8902653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:40:04+00:00 2026-06-15T01:40:04+00:00

I’m making an iOS game in Monotouch with C# and MonoDevelop. I’m having a

  • 0

I’m making an iOS game in Monotouch with C# and MonoDevelop. I’m having a very strange crash.

Background Information: Making a 2D war game. I’ve implemented Dijkstra’s algorithm to calculate the shortest path from source to destination with objects in-between (example: go from here to there but go around the cars/trees/buildings/or anything in the way automatically). My crash seems to be related to the 2D array of bytes that I created for this implementation of Dijkstra’s algorithm. See this image if you’ve never heard of Dijkstra’s algorithm http://en.wikipedia.org/wiki/File:Dijkstras_progress_animation.gif

Basically, the more nodes I have in my 2D array, the more detail in the soldier’s movement on the battlefield. If I use 2,400 nodes in my 2D array, everything works/loads fine. However, if I increase the number of nodes to 4,266 for more detailed coordinates, the program crashes when it’s calculating the node’s distances. It get’s approximately 30% finished before it crashes.

More Details on the crash: it only crashes when I use Debug/iPhone mode or Release/iPhone mode. When I use the Debug/iPhone Simulator it works fine. And another note, when I build the app and transfer it to my phone using Debug/iPhone mode, then stop the debugger, open XCode Instruments, it works fine! I can’t figure out why it would work in the simulator and with XCode Instruments but NOT with the Monodevelop Debug/iPhone mode. Is XCode Instruments doing something that “patches” up the problem? Or is MonoDevelop’s debugger doing something to “break” the program?

Here is a screenshot of the program working in XCode Instruments:

Let me explain what you’re looking at in the screenshot. My app is called “WarGame”. Looking at the timeline, the CPU usage was ~100% from around 2 seconds to about 35 seconds. When the CPU usage drops down to zero, it’s finished loading. So it literally took about 33 seconds to load the 2D Array of Nodes and populate them with Distances.

Keep in mind in this instance that crashes there are 4,266 nodes which means that the 2D array is a byte [4266, 4266] array. So that’s 18,198,756 bytes in a 2D array. And it loads successfully when being run by XCode Instruments and it loads successfully when run in MonoDevelop’s Debug/iPhone Simulator. But it crashes with no error message when run in the Debug/iPhone mode on my iPhone 4s. The memory usage of this app is approximately 60.73MB seen in the screenshots.

In the instance that does NOT crash, there were 2,400 nodes which means that the 2D array is a byte [2400, 2400] array. So that’s 5,760,000 bytes in a 2D array. And that one worked fine everywhere.

The problem clearly seems to be, when I increase the number of nodes to around 4,266 or more the program crashes. But I don’t get an error message, it just stops suddenly when it’s loading… Could this be a garbage collection issue? You’d think I’d get an error message for that right? Could this be an “out of memory” issue? But when it loads using XCode’s Instruments it says I’m only using 60MB, and I’ve used up to 150MB in this app as a test before, so I know I can atleast go up to 150MB of memory usage before it crashes with an “out of memory error”.

Here's a shot of the memory allocations from XCode Instruments
Here’s a shot of the memory allocations from XCode Instruments

Here's a shot of the memory leak's page from XCode Instruments
Here’s a shot of the memory leak’s page from XCode Instruments

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:40:06+00:00Added an answer on June 15, 2026 at 1:40 am

    That is strange. It looks like a debugger bug, likely an out-of-memory condition when the debugger is used (since that will need more memory than a normal build).

    However you should be able to start a release build manually without the issue… as you do with Xcode’s Instruments.

    I suspect there’s than one issue in play. E.g. it takes too long to start your application and the watchdog kills it (for release build). That would still work when starting from Xcode’s Instrument since it will silence the watchdog.

    I cannot be more precise without a lot more information (not suited for stackoverflow). I suggest you open a bug report and attach the crash logs for both a debug build (started by MonoDevelop) and a release build (started manually).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a view passing on information from a database: def serve_article(request, id): served_article
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm making a simple page using Google Maps API 3. My first. One marker
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.