Algorithm of calculation of chunk size was added. Part 3. Error in calculations was fixed.
@@ -2751,12 +2751,12 @@ public final class OWOWCache extends OAbstractWriteCache implements OWriteCache,
}
flushTs = System.nanoTime();
- } while ((flushTs - startFlushTs) / 1_000_000_000 < pagesFlushInterval && !localDirtyPages.isEmpty());
+ } while ((flushTs - startFlushTs) / 1_000_000 < pagesFlushInterval && !localDirtyPages.isEmpty());
if (lsnPages > 0) {
final long nsPerPage = (flushTs - startFlushTs) / lsnPages;
if (nsPerPage > 0) {
- chunkSize = (int) ((pagesFlushInterval * 1_000_000_000) / nsPerPage);
+ chunkSize = (int) ((pagesFlushInterval * 1_000_000) / nsPerPage);
if (chunkSize < 1) {
chunkSize = 1;
