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

Unified Diff: include/v8.h

Issue 1058253003: Adding V8 api to get memory statistics of spaces in V8::Heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 8019a4522b4bafb811263bc39bb53e516fbeb2b6..0884f9b8ca79d78f838e2bcded5f1aef1c17c936 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4853,12 +4853,34 @@ typedef void (*InterruptCallback)(Isolate* isolate, void* data);
class V8_EXPORT HeapStatistics {
public:
HeapStatistics();
+
+ class SpaceStatistics {
+ public:
+ size_t size() { return size_of_objects_; }
+ size_t committed_memory() { return committed_memory_; }
+ size_t avalable() { return available_memory_; }
+
+ private:
+ size_t size_of_objects_;
+ size_t committed_memory_;
+ size_t available_memory_;
+
+ friend class HeapStatisticsHelper;
+ };
+
size_t total_heap_size() { return total_heap_size_; }
size_t total_heap_size_executable() { return total_heap_size_executable_; }
size_t total_physical_size() { return total_physical_size_; }
size_t used_heap_size() { return used_heap_size_; }
size_t heap_size_limit() { return heap_size_limit_; }
+ SpaceStatistics* new_space_statistics() { return &new_space_stats_; }
+ SpaceStatistics* old_space_statistics() { return &old_space_stats_; }
+ SpaceStatistics* code_space_statistics() { return &code_space_stats_; }
+ SpaceStatistics* map_space_statistics() { return &map_space_stats_; }
+ SpaceStatistics* cell_space_statistics() { return &cell_space_stats_; }
+ SpaceStatistics* lo_space_statistics() { return &lo_space_stats_; }
+
private:
size_t total_heap_size_;
size_t total_heap_size_executable_;
@@ -4866,7 +4888,14 @@ class V8_EXPORT HeapStatistics {
size_t used_heap_size_;
size_t heap_size_limit_;
- friend class V8;
+ SpaceStatistics new_space_stats_;
+ SpaceStatistics old_space_stats_;
+ SpaceStatistics code_space_stats_;
+ SpaceStatistics map_space_stats_;
+ SpaceStatistics cell_space_stats_;
+ SpaceStatistics lo_space_stats_;
rmcilroy 2015/04/13 12:48:23 Maybe we want to make this a bit more opaque to av
+
+ friend class HeapStatisticsHelper;
friend class Isolate;
};
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698