Commit ecdaaa93 authored by Maks Orlovich's avatar Maks Orlovich Committed by Commit Bot

Revert "SQLitePersistentCookieStore: Attempt to diagnose occasional heavy memory consumption"

This reverts commit 1e3d315d.

Reason for revert: Coalescing looks to have helped, no longer need debugging machinery.
Bug: 896880

Original change's description:
> SQLitePersistentCookieStore: Attempt to diagnose occasional heavy memory consumption
>
> From leak reports, it seems like sometimes the pending operations queue
> just keeps growing and growing, but we still don't know why... so
> DumpWithoutCrashing (once per backend lifetime) if it seems ridiculously
> long.
>
> Thanks to mef@ for the idea.
>
> Bug: 809199
> Change-Id: Ia949be30e50ddcd6f800c4c26268966b6e298bc0
> Reviewed-on: https://chromium-review.googlesource.com/1210367
> Commit-Queue: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Victor Costan <pwnall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#589236}

Bug: 809199
Change-Id: I1ea0cce2ab6987a3b4afb752a5fa2d463be4c9f0
Reviewed-on: https://chromium-review.googlesource.com/c/1329345Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarMaks Orlovich <morlovich@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607306}
parent ce731513
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/debug/alias.h"
#include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
...@@ -200,7 +198,6 @@ class SQLitePersistentCookieStore::Backend ...@@ -200,7 +198,6 @@ class SQLitePersistentCookieStore::Backend
initialized_(false), initialized_(false),
corruption_detected_(false), corruption_detected_(false),
restore_old_session_cookies_(restore_old_session_cookies), restore_old_session_cookies_(restore_old_session_cookies),
reported_giant_queue_(false),
num_cookies_read_(0), num_cookies_read_(0),
client_task_runner_(client_task_runner), client_task_runner_(client_task_runner),
background_task_runner_(background_task_runner), background_task_runner_(background_task_runner),
...@@ -332,9 +329,6 @@ class SQLitePersistentCookieStore::Backend ...@@ -332,9 +329,6 @@ class SQLitePersistentCookieStore::Backend
// Batch a cookie operation (add or delete) // Batch a cookie operation (add or delete)
void BatchOperation(PendingOperation::OperationType op, void BatchOperation(PendingOperation::OperationType op,
const CanonicalCookie& cc); const CanonicalCookie& cc);
void ReportGiantQueue(size_t size);
// Commit our pending operations to the database. // Commit our pending operations to the database.
void Commit(); void Commit();
// Close() executed on the background runner. // Close() executed on the background runner.
...@@ -385,10 +379,6 @@ class SQLitePersistentCookieStore::Backend ...@@ -385,10 +379,6 @@ class SQLitePersistentCookieStore::Backend
// If false, we should filter out session cookies when reading the DB. // If false, we should filter out session cookies when reading the DB.
bool restore_old_session_cookies_; bool restore_old_session_cookies_;
// If true, we already reported a failure due to seemingly wedged
// operations queue, so don't do it again.
bool reported_giant_queue_;
// The cumulative time spent loading the cookies on the background runner. // The cumulative time spent loading the cookies on the background runner.
// Incremented and reported from the background runner. // Incremented and reported from the background runner.
base::TimeDelta cookie_load_duration_; base::TimeDelta cookie_load_duration_;
...@@ -1287,10 +1277,6 @@ void SQLitePersistentCookieStore::Backend::BatchOperation( ...@@ -1287,10 +1277,6 @@ void SQLitePersistentCookieStore::Backend::BatchOperation(
static const int kCommitIntervalMs = 30 * 1000; static const int kCommitIntervalMs = 30 * 1000;
// Commit right away if we have more than 512 outstanding operations. // Commit right away if we have more than 512 outstanding operations.
static const size_t kCommitAfterBatchSize = 512; static const size_t kCommitAfterBatchSize = 512;
// Threshold after which we report a problem.
static const size_t kReportGiantQueueSizeThreshold = 50 * 1024;
DCHECK(!background_task_runner_->RunsTasksInCurrentSequence()); DCHECK(!background_task_runner_->RunsTasksInCurrentSequence());
// We do a full copy of the cookie here, and hopefully just here. // We do a full copy of the cookie here, and hopefully just here.
...@@ -1343,19 +1329,9 @@ void SQLitePersistentCookieStore::Backend::BatchOperation( ...@@ -1343,19 +1329,9 @@ void SQLitePersistentCookieStore::Backend::BatchOperation(
} else if (num_pending == kCommitAfterBatchSize) { } else if (num_pending == kCommitAfterBatchSize) {
// We've reached a big enough batch, fire off a commit now. // We've reached a big enough batch, fire off a commit now.
PostBackgroundTask(FROM_HERE, base::Bind(&Backend::Commit, this)); PostBackgroundTask(FROM_HERE, base::Bind(&Backend::Commit, this));
} else if (num_pending >= kReportGiantQueueSizeThreshold &&
!reported_giant_queue_) {
ReportGiantQueue(num_pending);
reported_giant_queue_ = true;
} }
} }
void SQLitePersistentCookieStore::Backend::ReportGiantQueue(
size_t num_pending) {
base::debug::Alias(&num_pending);
base::debug::DumpWithoutCrashing();
}
void SQLitePersistentCookieStore::Backend::Commit() { void SQLitePersistentCookieStore::Backend::Commit() {
DCHECK(background_task_runner_->RunsTasksInCurrentSequence()); DCHECK(background_task_runner_->RunsTasksInCurrentSequence());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment