Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: src/heap.cc

Issue 10961042: Implement committed physical memory stats for Linux. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 return new_space_.CommittedMemory() + 205 return new_space_.CommittedMemory() +
206 old_pointer_space_->CommittedMemory() + 206 old_pointer_space_->CommittedMemory() +
207 old_data_space_->CommittedMemory() + 207 old_data_space_->CommittedMemory() +
208 code_space_->CommittedMemory() + 208 code_space_->CommittedMemory() +
209 map_space_->CommittedMemory() + 209 map_space_->CommittedMemory() +
210 cell_space_->CommittedMemory() + 210 cell_space_->CommittedMemory() +
211 lo_space_->Size(); 211 lo_space_->Size();
212 } 212 }
213 213
214
215 size_t Heap::CommittedPhysicalMemory() {
216 if (!HasBeenSetUp()) return 0;
217
218 return new_space_.CommittedPhysicalMemory() +
219 old_pointer_space_->CommittedPhysicalMemory() +
220 old_data_space_->CommittedPhysicalMemory() +
221 code_space_->CommittedPhysicalMemory() +
222 map_space_->CommittedPhysicalMemory() +
223 cell_space_->CommittedPhysicalMemory() +
224 lo_space_->CommittedPhysicalMemory();
225 }
226
227
214 intptr_t Heap::CommittedMemoryExecutable() { 228 intptr_t Heap::CommittedMemoryExecutable() {
215 if (!HasBeenSetUp()) return 0; 229 if (!HasBeenSetUp()) return 0;
216 230
217 return isolate()->memory_allocator()->SizeExecutable(); 231 return isolate()->memory_allocator()->SizeExecutable();
218 } 232 }
219 233
220 234
221 intptr_t Heap::Available() { 235 intptr_t Heap::Available() {
222 if (!HasBeenSetUp()) return 0; 236 if (!HasBeenSetUp()) return 0;
223 237
(...skipping 7096 matching lines...) Expand 10 before | Expand all | Expand 10 after
7320 static_cast<int>(object_sizes_last_time_[index])); 7334 static_cast<int>(object_sizes_last_time_[index]));
7321 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7335 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7322 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7336 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7323 7337
7324 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7338 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7325 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7339 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7326 ClearObjectStats(); 7340 ClearObjectStats();
7327 } 7341 }
7328 7342
7329 } } // namespace v8::internal 7343 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698