Excessive file size

Dec 15, 2011 at 11:59 AM

I run into an interesting issue with esent regarding the file size. I am saving 1024 records, which should take roughly 1 MB.

However, the file size on disk is 32 MB, and the reported file size from esent is 17 Mb.

I have a full repro here, which shows the exact problem: 

https://gist.github.com/1481011

 

Any idea how to get the file size to something close to what we store inside it?

Dec 15, 2011 at 12:19 PM

It looks like the controling factor is DbExtensionSize, which is causing the problem. But there is still a big disparity between the actual file size and the reported file size.

Any ideas?

Developer
Jan 21, 2012 at 1:18 AM

You are correct that the DbExtensionSize is in play. It's set in the number of pages, so when the file grows it will be 4098*4096 = 16785408 (i.e. 16 MB).

BTW, did you mean 4098, and not 4096?

Your code may be a bit simpler if you use JetGetDatabaseFileInfo instead.

You can dump the space information of the file by using `esentutl.exe -ms database.edb`. It can be a bit cryptic to understand though. This is an old article, and you can ignore the parts about SLVs. Look at where they talk about priv1.edb. http://technet.microsoft.com/en-us/library/aa996139(EXCHG.65).aspx

 

-martin

Jan 21, 2012 at 7:15 AM
Yes, I meant 4096
I understand the Db Extenstion Size. What I don't get is why there is a big disparity between the reported size from the API and the OS size.

On Fri, Jan 20, 2012 at 9:18 PM, martinc <notifications@codeplex.com> wrote:

From: martinc

You are correct that the DbExtensionSize is in play. It's set in the number of pages, so when the file grows it will be 4098*4096 = 16785408 (i.e. 16 MB).

BTW, did you mean 4098, and not 4096?

Your code may be a bit simpler if you use JetGetDatabaseFileInfo instead.

You can dump the space information of the file by using `esentutl.exe -ms database.edb`. It can be a bit cryptic to understand though. This is an old article, and you can ignore the parts about SLVs. Look at where they talk about priv1.edb. http://technet.microsoft.com/en-us/library/aa996139(EXCHG.65).aspx

-martin

Read the full discussion online.

To add a post to this discussion, reply to this email (ManagedEsent@discussions.codeplex.com)

To start a new discussion for this project, email ManagedEsent@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com