Out of memory exceptions with V1.0 release 9

Hi folks - left Roon running overnight and this morning the server had crashed - it seems to have run out of memory. Nothing much else was running on this Mac - I had even closed iTunes. Excerpt from log file as follows:

05/31 05:18:19 Info: [stats] 3878mb Virtual, 2697mb Physical, 1665mb Managed, 57 Threads, 239 FDs (177 REG, 34 IPv4, 11 DIR, 7 KQUEUE, 5 CHR, 3 PIPE, 1 unix, 1 systm)
05/31 05:18:22 Error: [streammediafile] error reading stream: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)
at (wrapper alloc) object:AllocVector (intptr,intptr)
at Base.ByteBuffer.Get (Int32 len) [0x00000] in :0
at Sooloos.RandomAccessBufferedStream._GetBlock () [0x00000] in :0
at Sooloos.RandomAccessBufferedStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in :0
at System.IO.BufferedStream.Read (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in :0
at Sooloos.Media.StreamMediaFile.ReadCallback (IntPtr userdata, IntPtr buf, IntPtr count, System.IntPtr& out_bytesread) [0x00000] in :0
05/31 05:18:22 Warn: [analysis] failed for trackid=7542834
05/31 05:18:22 Trace: [analysis] analyzing trackid=7542578 url=cifsstorage://d7f507cdb74fb269f3e583cae9ebe45e/iTunes Music/Pixie Lott/Turn It Up/03 Band Aid 2.m4a
05/31 05:18:24 Error: [streammediafile] error reading stream: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)
at (wrapper alloc) object:AllocVector (intptr,intptr)
at Base.ByteBuffer.Get (Int32 len) [0x00000] in :0
at Sooloos.RandomAccessBufferedStream._GetBlock () [0x00000] in :0
at Sooloos.RandomAccessBufferedStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in :0
at System.IO.BufferedStream.Read (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in :0
at Sooloos.Media.StreamMediaFile.ReadCallback (IntPtr userdata, IntPtr buf, IntPtr count, System.IntPtr& out_bytesread) [0x00000] in :0
05/31 05:18:24 Warn: [analysis] corrupt excn for trackid=7542578
05/31 05:18:24 Trace: [library] finished with 124 dirty tracks 10 dirty albums 5 dirty performers 18 dirty works 1 dirty performances 10 dirty creditroles 0 clumping tracks, 0 compute tracks, 0 deleted tracks, 1 tracks to (re)load, 0 tracks to retain, and 7 changed objects
05/31 05:18:24 Critical: scx: in OnExit: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)
at (wrapper alloc) object:AllocVector (intptr,intptr)
at Base.ByteBuffer.Get (Int32 len) [0x00000] in :0
at Sooloos.RandomAccessBufferedStream._GetBlock () [0x00000] in :0
at Sooloos.RandomAccessBufferedStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in :0
at System.IO.BufferedStream.Read (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in :0
at Sooloos.Media.StreamMediaFile.ReadCallback (IntPtr userdata, IntPtr buf, IntPtr count, System.IntPtr& out_bytesread) [0x00000] in :0
05/31 05:18:24 Critical: scx: in OnExit: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)
at (wrapper alloc) object:AllocVector (intptr,intptr)
at Base.ByteBuffer.Get (Int32 len) [0x00000] in :0
at Sooloos.RandomAccessBufferedStream._GetBlock () [0x00000] in :0
at Sooloos.RandomAccessBufferedStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in :0
at System.IO.BufferedStream.Read (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in :0
at Sooloos.Media.StreamMediaFile.ReadCallback (IntPtr userdata, IntPtr buf, IntPtr count, System.IntPtr& out_bytesread) [0x00000] in :0
05/31 05:18:24 Critical: scx: in OnExit: System.OutOfMemoryException: Out of memory
at (wrapper managed-to-native) object:__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)

Please take a look and let me know if you need the full log file. There are a lot of exceptions after this one - thanks

Hey @pcwilliams@vova and I will be in touch to get some logs here. Tough week :frowning:

This is almost certainly caused by a giant logfile associated with a managed crash. I see badness in our code where the entire logfile is loaded into memory. I’m looking to fix this.

In the meantime, if you blow away log files ($HOME/Library/Roon/Logs) and serialized crashes ($HOME/Library/Roon/Database/Cx) this will stop (at least until you crash again with big log files…).