New issue
Advanced search Search tips

Issue 732817 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Potential memory leak with SafeBrowser model

Project Member Reported by etienneb@chromium.org, Jun 13 2017

Issue description

I ran a long-running test that was navigating to a restricted set of web pages for a whole day. The browser process was kept alive the whole time. Memory dumps using memory-infra are taken at the beginning and at the end of the experiment.

Some remaining allocation are related to safe browsing model. As I get this, this is a model that can be updated periodically. I can't tell if this is a leak or if this is a growing database.

8520 objects
      "operator new",
      "google::protobuf::Arena::Create<safe_browsing::ClientSideModel_Rule>",
      "google::protobuf::internal::RepeatedPtrFieldBase::Add<google::protobuf::RepeatedPtrField<safe_browsing::ClientSideModel_Rule>::TypeHandler>",
      "safe_browsing::ClientSideModel::MergePartialFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineMergeFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineParseFromArray",
      "safe_browsing::ModelLoader::OnURLFetchComplete",
      "net::URLFetcherCore::InformDelegateFetchIsComplete",
      "net::URLFetcherCore::OnCompletedURLRequest",
      "base::internal::Invoker<base::internal::BindState<void (__cdecl net::URLFetcherCore::*)(base::TimeDelta) __ptr64,scoped_refptr<net::URLFetcherCore>,base::TimeDelta>,void __cdecl(void)>::Run",
      "base::debug::TaskAnnotator::RunTask",
      "base::MessageLoop::RunTask",
      "base::MessageLoop::DoWork",
      "base::MessagePumpForUI::DoRunLoop",
      "base::MessagePumpWin::Run",
      "base::RunLoop::Run",
      "ChromeBrowserMainParts::MainMessageLoopRun",
      "content::BrowserMainLoop::RunMainMessageLoopParts",
      "content::BrowserMainRunnerImpl::Run",
      "content::BrowserMain",
      "content::RunNamedProcessTypeMain",
      "content::ContentMainRunnerImpl::Run",
      "service_manager::Main",
      "content::ContentMain",
      "ChromeMain",
      "MainDllLoader::Launch",
      "wWinMain",
      "__scrt_common_main_seh",
      "BaseThreadInitThunk",
      "RtlUserThreadStart",
      "[Thread: CrBrowserMain]"


8516 objects
      "operator new",
      "google::protobuf::RepeatedField<int>::Reserve",
      "google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<int,5>",
      "safe_browsing::ClientSideModel_Rule::MergePartialFromCodedStream",
      "safe_browsing::ClientSideModel::MergePartialFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineMergeFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineParseFromArray",
      "safe_browsing::ModelLoader::OnURLFetchComplete",
      "net::URLFetcherCore::InformDelegateFetchIsComplete",
      "net::URLFetcherCore::OnCompletedURLRequest",
      "base::internal::Invoker<base::internal::BindState<void (__cdecl net::URLFetcherCore::*)(base::TimeDelta) __ptr64,scoped_refptr<net::URLFetcherCore>,base::TimeDelta>,void __cdecl(void)>::Run",
      "base::debug::TaskAnnotator::RunTask",
      "base::MessageLoop::RunTask",
      "base::MessageLoop::DoWork",
      "base::MessagePumpForUI::DoRunLoop",
      "base::MessagePumpWin::Run",
      "base::RunLoop::Run",
      "ChromeBrowserMainParts::MainMessageLoopRun",
      "content::BrowserMainLoop::RunMainMessageLoopParts",
      "content::BrowserMainRunnerImpl::Run",
      "content::BrowserMain",
      "content::RunNamedProcessTypeMain",
      "content::ContentMainRunnerImpl::Run",
      "service_manager::Main",
      "content::ContentMain",
      "ChromeMain",
      "MainDllLoader::Launch",
      "wWinMain",
      "__scrt_common_main_seh",
      "BaseThreadInitThunk",
      "RtlUserThreadStart",
      "[Thread: CrBrowserMain]"


5764 objects
      "base::debug::StackTrace::StackTrace",
      "base::trace_event::AllocationContextTracker::GetContextSnapshot",
      "base::trace_event::MallocDumpProvider::InsertAllocation",
      "base::trace_event::`anonymous namespace'::HookAlloc",
      "malloc",
      "operator new",
      "std::_Allocate",
      "std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy",
      "std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append",
      "google::protobuf::io::CodedInputStream::InternalReadStringInline",
      "google::protobuf::internal::WireFormatLite::ReadBytes",
      "safe_browsing::ClientSideModel::MergePartialFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineMergeFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineParseFromArray",
      "safe_browsing::ModelLoader::OnURLFetchComplete",
      "net::URLFetcherCore::InformDelegateFetchIsComplete",
      "net::URLFetcherCore::OnCompletedURLRequest",
      "base::internal::Invoker<base::internal::BindState<void (__cdecl net::URLFetcherCore::*)(base::TimeDelta) __ptr64,scoped_refptr<net::URLFetcherCore>,base::TimeDelta>,void __cdecl(void)>::Run",
      "base::debug::TaskAnnotator::RunTask",
      "base::MessageLoop::RunTask",
      "base::MessageLoop::DoWork",
      "base::MessagePumpForUI::DoRunLoop",
      "base::MessagePumpWin::Run",
      "base::RunLoop::Run",
      "ChromeBrowserMainParts::MainMessageLoopRun",
      "content::BrowserMainLoop::RunMainMessageLoopParts",
      "content::BrowserMainRunnerImpl::Run",
      "content::BrowserMain",
      "content::RunNamedProcessTypeMain",
      "content::ContentMainRunnerImpl::Run",
      "service_manager::Main",
      "content::ContentMain",
      "ChromeMain",
      "MainDllLoader::Launch",
      "wWinMain",
      "__scrt_common_main_seh",
      "BaseThreadInitThunk",
      "RtlUserThreadStart",
      "[Thread: CrBrowserMain]"



      "malloc",
      "operator new",
      "google::protobuf::Arena::Create<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >",
      "google::protobuf::RepeatedPtrField<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::Add",
      "safe_browsing::ClientSideModel::MergePartialFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineMergeFromCodedStream",
      "google::protobuf::`anonymous namespace'::InlineParseFromArray",
      "safe_browsing::ModelLoader::OnURLFetchComplete",
      "net::URLFetcherCore::InformDelegateFetchIsComplete",
      "net::URLFetcherCore::OnCompletedURLRequest",
      "base::internal::Invoker<base::internal::BindState<void (__cdecl net::URLFetcherCore::*)(base::TimeDelta) __ptr64,scoped_refptr<net::URLFetcherCore>,base::TimeDelta>,void __cdecl(void)>::Run",
      "base::debug::TaskAnnotator::RunTask",
      "base::MessageLoop::RunTask",
      "base::MessageLoop::DoWork",
      "base::MessagePumpForUI::DoRunLoop",
      "base::MessagePumpWin::Run",
      "base::RunLoop::Run",
      "ChromeBrowserMainParts::MainMessageLoopRun",
      "content::BrowserMainLoop::RunMainMessageLoopParts",
      "content::BrowserMainRunnerImpl::Run",
      "content::BrowserMain",
      "content::RunNamedProcessTypeMain",
      "content::ContentMainRunnerImpl::Run",
      "service_manager::Main",
      "content::ContentMain",
      "ChromeMain",
      "MainDllLoader::Launch",
      "wWinMain",
      "__scrt_common_main_seh",
      "BaseThreadInitThunk",
      "RtlUserThreadStart",
      "[Thread: CrBrowserMain]"
 
Cc: nparker@chromium.org
Nathan, can you give us more information about this code.
The code loads one or two CSD models from network or cache just after startup, and unmarshals those protos. Then it schedules a re-load for when the model would expire (based on cache TTL), which I think is 7 days. It shouldn't be doing much else in the meantime.
Oh, and the models are copied to the renderer so they can be used there.

Comment 4 by vakh@chromium.org, Jun 16 2017

Owner: etienneb@chromium.org
etienneb -- is there a way to reproduce this easily?
It could be observed by running the long_running benchmark.

  % python tools\perf\run_benchmark memory.long_running_desktop_sites

The traces will contains memory dumps (memory-infra).


> ... or cache just after startup,

How long does it take for the model to be loaded. I can check whether it's growing up between day 2 and day 4, instead of just after the startup.
It's loaded 10 seconds after startup.

Comment 7 by vakh@chromium.org, Jun 30 2017

Labels: SafeBrowsing-Triaged
Status: Assigned (was: Untriaged)

Comment 8 by est...@chromium.org, Nov 10 2017

Labels: Hotlist-EnamelAndFriendsFixIt

Comment 9 by est...@chromium.org, Feb 18 2018

Labels: -Hotlist-EnamelAndFriendsFixIt

Sign in to add a comment