Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/memory/tab_manager_delegate_chromeos.h" | 5 #include "chrome/browser/memory/tab_manager_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 629 // The estimation is problematic since multiple tabs may share the same | 629 // The estimation is problematic since multiple tabs may share the same |
| 630 // process, while the calculation counts memory used by the whole process. | 630 // process, while the calculation counts memory used by the whole process. |
| 631 // So |estimated_memory_freed_kb| is an over-estimation. | 631 // So |estimated_memory_freed_kb| is an over-estimation. |
| 632 int estimated_memory_freed_kb = | 632 int estimated_memory_freed_kb = |
| 633 mem_stat_->EstimatedMemoryFreedKB(it->tab()->renderer_handle); | 633 mem_stat_->EstimatedMemoryFreedKB(it->tab()->renderer_handle); |
| 634 if (KillTab(tab_id)) { | 634 if (KillTab(tab_id)) { |
| 635 target_memory_to_free_kb -= estimated_memory_freed_kb; | 635 target_memory_to_free_kb -= estimated_memory_freed_kb; |
| 636 MemoryKillsMonitor::LogLowMemoryKill("TAB", estimated_memory_freed_kb); | 636 MemoryKillsMonitor::LogLowMemoryKill("TAB", estimated_memory_freed_kb); |
| 637 MEMORY_LOG(ERROR) << "Killed " << *it << ", estimated " | 637 MEMORY_LOG(ERROR) << "Killed " << *it << ", estimated " |
| 638 << estimated_memory_freed_kb << " KB freed"; | 638 << estimated_memory_freed_kb << " KB freed"; |
| 639 } else { | |
| 640 MEMORY_LOG(ERROR) << "Failed to kill " << *it; | |
|
Yusuke Sato
2017/05/12 20:47:08
What about changing this to VLOG? For debugging pu
cylee1
2017/05/12 21:04:40
Personally I don't think so.
Particularly a tab i
| |
| 641 } | 639 } |
| 642 } | 640 } |
| 643 } | 641 } |
| 644 if (target_memory_to_free_kb > 0) { | 642 if (target_memory_to_free_kb > 0) { |
| 645 MEMORY_LOG(ERROR) | 643 MEMORY_LOG(ERROR) |
| 646 << "Unable to kill enough candidates to meet target_memory_to_free_kb "; | 644 << "Unable to kill enough candidates to meet target_memory_to_free_kb "; |
| 647 } | 645 } |
| 648 } | 646 } |
| 649 | 647 |
| 650 void TabManagerDelegate::AdjustOomPrioritiesImpl( | 648 void TabManagerDelegate::AdjustOomPrioritiesImpl( |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 772 priority += priority_increment; | 770 priority += priority_increment; |
| 773 } | 771 } |
| 774 | 772 |
| 775 if (oom_scores_to_change.size()) { | 773 if (oom_scores_to_change.size()) { |
| 776 GetDebugDaemonClient()->SetOomScoreAdj( | 774 GetDebugDaemonClient()->SetOomScoreAdj( |
| 777 oom_scores_to_change, base::Bind(&OnSetOomScoreAdj)); | 775 oom_scores_to_change, base::Bind(&OnSetOomScoreAdj)); |
| 778 } | 776 } |
| 779 } | 777 } |
| 780 | 778 |
| 781 } // namespace memory | 779 } // namespace memory |
| OLD | NEW |