From a151fce1ca1f1432cdc60b6676ffea5e1a6107c7 Mon Sep 17 00:00:00 2001 From: Charles Dick Date: Wed, 22 Feb 2017 11:14:26 -0800 Subject: [PATCH] refactor jscMemoryMetrics to use HeapStats Reviewed By: amnn Differential Revision: D4558963 fbshipit-source-id: 8b729c6ce288d30b8d069be34f9db7572d8b3ec4 --- ReactCommon/cxxreact/JSCPerfStats.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/cxxreact/JSCPerfStats.cpp b/ReactCommon/cxxreact/JSCPerfStats.cpp index bf53100e7..1729cfd91 100644 --- a/ReactCommon/cxxreact/JSCPerfStats.cpp +++ b/ReactCommon/cxxreact/JSCPerfStats.cpp @@ -25,6 +25,10 @@ static JSValueRef nativeGetHeapStats( result.setProperty("extra_size", {ctx, Value::makeNumber(ctx, heapStats.extraSize)}); result.setProperty("capacity", {ctx, Value::makeNumber(ctx, heapStats.capacity)}); result.setProperty("object_count", {ctx, Value::makeNumber(ctx, heapStats.objectCount)}); + result.setProperty("object_size", {ctx, Value::makeNumber(ctx, heapStats.objectSizeAfterLastCollect)}); + result.setProperty("object_capacity", {ctx, Value::makeNumber(ctx, heapStats.objectCapacityAfterLastCollect)}); + result.setProperty("block_size", {ctx, Value::makeNumber(ctx, heapStats.blockSize)}); + result.setProperty("malloc_size", {ctx, Value::makeNumber(ctx, heapStats.mallocSize)}); return (JSObjectRef) result; }