Chromium Code Reviews| Index: chrome/browser/memory/tab_manager_delegate_chromeos.cc |
| diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos.cc b/chrome/browser/memory/tab_manager_delegate_chromeos.cc |
| index 39a0f0cb50049b8a70f0d4c4847fb22da97faa94..ce60fb4baf11f77bd8b4d1c15306726abe71667d 100644 |
| --- a/chrome/browser/memory/tab_manager_delegate_chromeos.cc |
| +++ b/chrome/browser/memory/tab_manager_delegate_chromeos.cc |
| @@ -121,13 +121,18 @@ std::ostream& operator<<(std::ostream& os, const ProcessType& type) { |
| std::ostream& operator<<( |
| std::ostream& out, const TabManagerDelegate::Candidate& candidate) { |
| if (candidate.app()) { |
| - out << "app " << candidate.app()->pid() << " (" |
| - << candidate.app()->process_name() << ")" |
| - << ", process_state " << candidate.app()->process_state() |
| - << ", is_focused " << candidate.app()->is_focused() |
| - << ", lastActivityTime " << candidate.app()->last_activity_time(); |
| + const auto& app = candidate.app(); |
|
teravest
2017/05/18 20:11:55
nit: Mind using the type explicitly here? It's not
Yusuke Sato
2017/05/18 20:27:36
Also, const auto& failed git-cl try. FYI.
cylee1
2017/05/18 21:10:30
Done.
|
| + out << "app " << app->process_name() << " (" << app->pid() << ")" |
|
Yusuke Sato
2017/05/18 20:24:51
How about moving this to c/b/c/arc/process/arc_pro
cylee1
2017/05/18 21:10:30
Done.
|
| + << ", process_state: " << app->process_state() |
|
Yusuke Sato
2017/05/18 20:24:51
Can you stringify the state number?
Yusuke Sato
2017/05/18 20:31:39
nvm, it's already done in the mojo-generated opera
cylee1
2017/05/18 21:10:30
It's already printed like
ProcessState::PERSISTENT
|
| + << ", is_focused: " << app->is_focused() |
| + << ", last_activity_time: " << app->last_activity_time(); |
|
Yusuke Sato
2017/05/18 20:24:51
Can you also dump packages_ vector?
cylee1
2017/05/18 21:10:30
Done.
|
| } else if (candidate.tab()) { |
| - out << "tab " << candidate.tab()->renderer_handle; |
| + const auto& tab = candidate.tab(); |
|
teravest
2017/05/18 20:11:55
nit: Mind using the type explicitly here? It's not
cylee1
2017/05/18 21:10:30
Done.
|
| + out << "tab " << tab->title << " (" << tab->renderer_handle << ")" |
|
Yusuke Sato
2017/05/18 20:24:52
How did you select the variables to dump? https://
cylee1
2017/05/18 21:10:30
I tried to select most relevant fields from my exp
Yusuke Sato
2017/05/18 21:42:49
Acknowledged.
|
| + << ", oom_score: " << tab->oom_score |
| + << ", is_discarded: " << tab->is_discarded |
| + << ", discard_count: " << tab->discard_count |
| + << ", last_active: " << tab->last_active; |
| } |
| out << ", process_type " << candidate.process_type(); |
| return out; |
| @@ -591,6 +596,10 @@ void TabManagerDelegate::LowMemoryKillImpl( |
| int target_memory_to_free_kb = mem_stat_->TargetMemoryToFreeKB(); |
| const TimeTicks now = TimeTicks::Now(); |
| + MEMORY_LOG(ERROR) << "List of all low memory kill candidates:"; |
|
Yusuke Sato
2017/05/18 20:24:51
Mention that the list is sorted?
cylee1
2017/05/18 21:10:30
Done.
|
| + for (auto it = candidates.rbegin(); it != candidates.rend(); ++it) { |
| + MEMORY_LOG(ERROR) << *it; |
| + } |
| // Kill processes until the estimated amount of freed memory is sufficient to |
| // bring the system memory back to a normal level. |
| // The list is sorted by descending importance, so we go through the list |