зеркало из https://github.com/mozilla/gecko-dev.git
Bug 658305 - Use journal_size_limit on places.sqlite.
r=dietrich
This commit is contained in:
Родитель
d2bb67796d
Коммит
adaec09bc1
|
@ -355,9 +355,10 @@ IsValidGUID(const nsCString& aGUID)
|
|||
void
|
||||
ForceWALCheckpoint(mozIStorageConnection* aDBConn)
|
||||
{
|
||||
// Use a FULL checkpoint to ensure the operation is not dismissed by writers.
|
||||
nsCOMPtr<mozIStorageAsyncStatement> stmt;
|
||||
(void)aDBConn->CreateAsyncStatement(NS_LITERAL_CSTRING(
|
||||
"pragma wal_checkpoint "
|
||||
"pragma wal_checkpoint(FULL)"
|
||||
), getter_AddRefs(stmt));
|
||||
nsCOMPtr<mozIStoragePendingStatement> handle;
|
||||
(void)stmt->ExecuteAsync(nsnull, getter_AddRefs(handle));
|
||||
|
|
|
@ -810,7 +810,17 @@ nsNavHistory::InitDB()
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Grow places in 10MiB increments
|
||||
// The journal is usually free to grow for performance reasons, but it never
|
||||
// shrinks back. Since the space taken may be problematic, especially on
|
||||
// mobile devices, limit its size.
|
||||
// Since exceeding the limit will cause a truncate, allow a slightly
|
||||
// larger limit than DATABASE_MAX_WAL_SIZE_IN_KIBIBYTES to reduce the number
|
||||
// of times it is needed.
|
||||
nsCAutoString journalSizePragma("PRAGMA journal_size_limit = ");
|
||||
journalSizePragma.AppendInt(DATABASE_MAX_WAL_SIZE_IN_KIBIBYTES * 3);
|
||||
(void)mDBConn->ExecuteSimpleSQL(journalSizePragma);
|
||||
|
||||
// Grow places in 10MiB increments to limit fragmentation on disk.
|
||||
(void)mDBConn->SetGrowthIncrement(10 * BYTES_PER_MEBIBYTE, EmptyCString());
|
||||
|
||||
// We use our functions during migration, so initialize them now.
|
||||
|
|
Загрузка…
Ссылка в новой задаче