CoreyKaylor / Lightning.NET

.NET library for LMDB key-value store
Other
399 stars 82 forks source link

i cant set the mapsize above the default value (10485760) #113

Closed jackkoolage closed 4 years ago

jackkoolage commented 4 years ago
 Using env = New LightningDB.LightningEnvironment(Application.StartupPath + "\Settings\ThumbDB", New LightningDB.EnvironmentConfiguration With {.MapSize = Convert.ToInt64(4294967296), .MaxDatabases = 1})
            env.Open()
            Using tx = env.BeginTransaction()
                Using db = tx.OpenDatabase("Thumbs", New LightningDB.DatabaseConfiguration With {.Flags = LightningDB.DatabaseOpenFlags.Create})
                    tx.Put(db, System.Text.Encoding.UTF8.GetBytes(ImgName), ImgByteArray)
                    tx.Commit()
                End Using
            End Using
        End Using

im using the 32x native lmdb lib

it throw

System.OverflowException: Arithmetic operation resulted in an overflow. at LightningDB.Native.Lmdb.mdb_env_set_mapsize(IntPtr env, Int64 size) at LightningDB.LightningEnvironment.set_MapSize(Int64 value) at LightningDB.EnvironmentConfiguration.Configure(LightningEnvironment env) at LightningDB.LightningEnvironment..ctor(String path, EnvironmentConfiguration configuration)

jackkoolage commented 4 years ago

after take a look at the code i realized if i use the 32 lib the max size i can use is 1 gb (int32)