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

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: Fixing build. 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 e32c104d484a7675a7e4700278390fa70a432d49..b7bf2a9d6c6511882476fa62a7f42ea962f8f150 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4901,6 +4901,26 @@ class V8_EXPORT HeapStatistics {
};
+class HeapSpaceStatistics {
+ public:
+ HeapSpaceStatistics();
+ const char* space_name() { return space_name_; }
+ size_t space_size() { return space_size_; }
+ size_t space_used_size() { return space_used_size_; }
+ size_t space_avalable_size() { return space_avalable_size_; }
rmcilroy 2015/04/16 13:49:05 Fix spelling typo (avalable -> available) througho
ssid 2015/04/16 16:40:29 Done.
+ size_t physical_space_size() { return physical_space_size_; }
+
+ private:
+ const char* space_name_;
+ size_t space_size_;
+ size_t space_used_size_;
+ size_t space_avalable_size_;
+ size_t physical_space_size_;
+
+ friend class Isolate;
+};
+
+
class RetainedObjectInfo;
@@ -5263,6 +5283,21 @@ class V8_EXPORT Isolate {
void GetHeapStatistics(HeapStatistics* heap_statistics);
/**
+ * Returns the number of spaces in the heap.
+ */
+ int NumberOfHeapSpaces();
+
+ /**
+ * Get the memory usage of a space in the heap.
rmcilroy 2015/04/16 13:49:05 nit - add 'Returns true on success'.
ssid 2015/04/16 16:40:29 Done.
rmcilroy 2015/04/16 16:53:36 You seem to have missed this.
+ *
+ * \param space_statistics the HeapSpaceStatistics object to fill in
+ * statistics.
+ * \param index ranges from 0 - number of spaces in the heap (given by
+ * NumberOfHeapSpaces()).
+ */
+ bool GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, int index);
+
+ /**
* Get a call stack sample from the isolate.
* \param state Execution state.
* \param frames Caller allocated buffer to store stack frames.
« 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