Skip to main content
Topic: FATAL ERROR: sim_new_handler (Read 3890 times) previous topic - next topic

FATAL ERROR: sim_new_handler

Error:

Quote
FATAL ERROR: sim_new_handler
OUT OF MEMORY
PRESS ANY KEY

Steps:
1. 102.0 with pak128
2. Create 64x32766 game
3. Open map
4. Click to zoom
5. Receive error

:D

(I think it took something like 12-15 mins to generate the game; it took a full minute to save it...)

Re: FATAL ERROR: sim_new_handler

Reply #1
That is a somewhat misleading error message, in that it does not necessarily mean that the system is out of physical and/or virtual memory. That is one possible cause of the error, but the error will be thrown whenever the allocation of further memory via the "new" keyword fails. That can also happen as a result of a bug either in the code calling the new object, or in the constructor code for the object itself (or in code to which the constructor code refers, or in code to which that code refers, and so on).

However, in your case, since you created such an enormous map, it seems likely that the reason for the error is that you really were out of memory. If that is so, that would not be a bug in the code, but simply an expression of the hardware limitations of your computer. Out of interest, how much physical RAM do you have?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: FATAL ERROR: sim_new_handler

Reply #2
As it happens, I was curious to see what it was using. That installation uses about 50MB of RAM (102 + paak128 + few extra paks), and the map claimed to be iirc 198MB; sure enough, I checked and it was around 250MB after loading the map. :)

I have 2GB.

However, note that the map itself loaded - but here was have another problem like the word "pak", which can refer to a file.pak, one or more additional objects (q.v. addons.simutrans.com), or an entire playable set. In the same way, "map" can refer to a playable game, or a window with the locations of things. Just to make sure I'm clear, it is the latter that caused the problem. Opening the map with that 'game' loaded worked fine, and I could scroll around, but as soon as I clicked to zoom in, I got the crash.

 

Re: FATAL ERROR: sim_new_handler

Reply #3
Hmm - odd.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: FATAL ERROR: sim_new_handler

Reply #4
How do you create a 64x32767 game? The maximum number allowed (which will be enforced is 32766). And this does not crash.

EDIT: minimap zoom out. Well, this is not solvable, as the maximum coordinates are 16 Bit within the game ... But the map window should disallow zooming in then of course.

Re: FATAL ERROR: sim_new_handler

Reply #5
typo, of course, sorry. 64x32766 :)

EDIT: Actually, I'd written "32667", which would be possible, but it was 32766 :) )