Random out of memory errors

Post here to get help with using or setting up fCraft
Post Reply
Denny6526
Offline
Posts: 8
Joined: December 22nd, 2011, 5:41 pm

Random out of memory errors

Post by Denny6526 »

I recently upgraded my RAM, and now whenever someone on the server uses /bi, it throws up an out of memory error.

1:42:33 PM > ERROR: Exception thrown by ScheduledTask callback: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
at System.IO.File.ReadAllBytes (System.String path) [0x00000] in <filename unknown>:0
at fCraft.BlockDB.Load () [0x00000] in <filename unknown>:0
at fCraft.BlockDB.Lookup (Vector3I coords) [0x00000] in <filename unknown>:0
at fCraft.WorldCommands.BlockInfoSchedulerCallback (fCraft.SchedulerTask task) [0x00000] in <filename unknown>:0
at fCraft.Scheduler.BackgroundLoop () [0x00000] in <filename unknown>:0
1:42:33 PM > Warning: fCraft ran out of memory. Make sure there is enough RAM to run.

^ there's the specific code that pops up.

Any suggestions?

EDIT: It never did this before I changed the RAM.

User avatar
boblol0909
SupOP
Offline
Posts: 314
Joined: June 24th, 2011, 10:27 pm

Re: Random out of memory errors

Post by boblol0909 »

1:42:33 PM > Warning: fCraft ran out of memory. Make sure there is enough RAM to run.
How much RAM did you have before and after? You may have either put in less ram, or your computer isn't recognizing all of the new memory.

Denny6526
Offline
Posts: 8
Joined: December 22nd, 2011, 5:41 pm

Re: Random out of memory errors

Post by Denny6526 »

Went from 2GB to 4, and the first thing I did was to see if it recognized all of it.

User avatar
fragmer
fCraft Developer
Offline
Posts: 1386
Joined: May 21st, 2011, 10:53 pm

Re: Random out of memory errors

Post by fragmer »

Looks like you are using Mono. Mono 2.6 has known memory leaks. I recommend switching to newer versions, which come bundled with improved memory management (generational garbage collection/GC technology).
To use the new garbage collector, you just need to invoke Mono with the --gc=sgen command line option, or set the MONO_ENV_OPTIONS environment variable to contain "--gc=sgen" option.
More information about generational GC.

Note that future versions of fCraft will require Mono 2.8+ to run.

Denny6526
Offline
Posts: 8
Joined: December 22nd, 2011, 5:41 pm

Re: Random out of memory errors

Post by Denny6526 »

That solved it, thanks.

Denny6526
Offline
Posts: 8
Joined: December 22nd, 2011, 5:41 pm

Re: Random out of memory errors

Post by Denny6526 »

I'm getting this every time I try running any of the server files with sgen

4:40:45 PM > ------ Log Starts Saturday, January 07, 2012 (1/7/2012) ------
4:40:45 PM > Running on Mono 2.10.8
4:40:45 PM > Working directory: /Users/Denny/Desktop/fcraft
4:40:45 PM > Log path: /Users/Denny/Desktop/fcraft/logs
4:40:45 PM > Map path: /Users/Denny/Desktop/fcraft/maps
4:40:45 PM > Config path: /Users/Denny/Desktop/fcraft/config.xml
4:40:45 PM > Config.Load: Config file config.xml loaded succesfully.
* Assertion at sgen-gc.c:2506, condition `mono_sgen_need_bridge_processing ()' not met

Stacktrace:

at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific (intptr,int) <0xffffffff>
at fCraft.Trie`1/TrieNode.LeafToSingle (byte) <0x00047>
at fCraft.Trie`1.Add (string,T,bool) <0x00153>
at fCraft.Trie`1.Add (string,T) <0x00017>
at fCraft.PlayerDB.Load () <0x005c7>
at fCraft.Server.InitServer () <0x0021b>
at fCraft.ServerCLI.Program.Main (string[]) <0x00143>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

0 mono-sgen 0x00092c6c mono_handle_native_sigsegv + 284
1 mono-sgen 0x000dcebd sigabrt_signal_handler + 109
2 libsystem_c.dylib 0x9229e59b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libsystem_c.dylib 0x92239bdd abort + 167
5 mono-sgen 0x00281ed3 monoeg_g_logv + 243
6 mono-sgen 0x00281f86 monoeg_assertion_message + 54
7 mono-sgen 0x001e6ab4 stw_bridge_process + 68
8 mono-sgen 0x001ee228 restart_world + 216
9 mono-sgen 0x001ea140 minor_collect_or_expand_inner + 288
10 mono-sgen 0x001eab32 mono_gc_alloc_obj_nolock + 1138
11 mono-sgen 0x001eb034 mono_gc_alloc_vector + 180
12 mono-sgen 0x001a964e mono_array_new_specific + 142
13 ??? 0x004f6818 0x0 + 5203992
14 ??? 0x02f584c0 0x0 + 49644736
15 ??? 0x02f5817c 0x0 + 49643900
16 ??? 0x02f57fc0 0x0 + 49643456
17 ??? 0x02f53ff8 0x0 + 49627128
18 ??? 0x01ff12bc 0x0 + 33493692
19 ??? 0x004f699c 0x0 + 5204380
20 ??? 0x004f6dd3 0x0 + 5205459
21 mono-sgen 0x0000cff2 mono_jit_runtime_invoke + 722
22 mono-sgen 0x001a4c8a mono_runtime_invoke + 170
23 mono-sgen 0x001a7821 mono_runtime_exec_main + 705
24 mono-sgen 0x001a6a31 mono_runtime_run_main + 929
25 mono-sgen 0x00067ee5 mono_jit_exec + 149
26 mono-sgen 0x0006a473 mono_main + 9603
27 mono-sgen 0x00002009 main + 441
28 mono-sgen 0x00001e16 start + 54

Debug info from gdb:


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

User avatar
fragmer
fCraft Developer
Offline
Posts: 1386
Joined: May 21st, 2011, 10:53 pm

Re: Random out of memory errors

Post by fragmer »

I'm guessing that's a bug in latest version of Mono. One of the recent Mono patches removed the bit of code that's causing this crash.

Denny6526
Offline
Posts: 8
Joined: December 22nd, 2011, 5:41 pm

Re: Random out of memory errors

Post by Denny6526 »

Is there some way I can apply that patch to the OSX version of mono now, or do I have to wait until they release it?

Post Reply