Got an out of memory exception at around ~ block 216,057. I had all three caches set to 100 however the system has 16GB of memory, roughly 12GB free. Looks like BitSharp.Client was using 958.6MB of memory at the time of the exception
BlockDataCache: DataCache encountered fatal exception in StorageWorker: "Exception of type 'System.OutOfMemoryException' was thrown."
at System.IO.MemoryStream.set_Capacity(Int32 value)\r\n at System.IO.MemoryStream.EnsureCapacity(Int32 value)\r\n at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)\r\n at System.IO.BinaryWriter.Write(Byte[] buffer)\r\n at...
Was able to restart and it resumed without issue. Stranglely it is running as a 32bit process so that may have had something to do with it. Need to check configuration settings as it should be building as Any CPU.
Yeah, I've had a rough time with running it in 32-bit as well. I do my best not to hold onto any objects for too long, but it seems that the GC struggles to keep up with the amount of objects going in and out of memory. I'm not a GC expert at all though, so I can't really say for sure what exactly's going in. It seems that I'm stressing things with the way I'm using ImmutableHashSet.
The issue wasn't so much 32bit process running out of memory. I can't seem to figure out why it was loading as a 32 bit process. Architecture was "AnyCPU".
The System.Data.SQLite assembly is "AnyCPU" (PE=PE32 & 32BITREQ=0) with no native code (ILONLY=1).
corflags System.Data.SQLite.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.17929
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 0x9
ILONLY : 1
32BITREQ : 0
32BITPREF : 0
Signed : 1
For some reason System.Data.SQLite is referencing the x86 not the x64 version of SQLite.Interop.dll forcing the entire assembly to run as a 32 bit process. Forcing x64 as architecture results in a "BadImageFormatException" exception on System.Data.SQLite so once again for some unknown reason it is loading the assembly as 32 bit. I am not sure why as the point of the split System.Data.SQLite.dll (managed AnyCPU wrapped) and SQLite.Interop.dll (native dll in both x86 and x64 versions) is to allow both x86 and x64 projects from the same reference right?
Anyways I bypassed the issue by just using the mixed mode x64 assembly.
http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wikiStill not sure exactly why it didn't work.
I'd really like to have this optimized for being able to quickly access the data, even if it does even up requiring 64-bit mode to run well.
Agreed. For my purposes x86 compatibility is a non-issue and as time goes on the data will only get larger. 32 bit general purpose clients make sense where the client is really only interested in the UXTO but for a general purpose parser to build blockchain related tools I see little value in trying to make x86 work.
I'd like it to be really simple to program against the node easily for things like querying data. At the moment I'm trying to figure out how I'm going to store historical transaction data in a manner that will allow for that that kind of querying access. I want the end result to really be able to scale, though. I'd like to make this as high throughput as I can... lots of work ahead.
Well a nice start so far. On my system it synced the blockchain from the genesis block significantly faster than bitcoind did.