MB-15348 Don't allocate the unnecessary large memory for compaction.
MB-15348 Don't allocate the unnecessary large memory for compaction.

If the offset of all docs in a file can be sorted using the buffer
whose size is smaller than 10% of the buffer cache, then we just
need to allocate the buffer whose size is num_of_docs * sizeof(offset).

Change-Id: I5666e69bad8ca4afb9413834c34ba03437c801c0

wurikiji/forestdb,yyangpan/forestdb,jinxuan/forestdb,hisundar/forestdb,joliss/forestdb,jinxuan/forestdb,sushmaad/forestdb,yyangpan/forestdb,hisundar/forestdb,couchbase/forestdb,wurikiji/forestdb,sushmaad/forestdb,zhaog/forestdb,couchbase/forestdb,zhaog/forestdb,joliss/forestdb