diff --git a/toolkit/devtools/server/tests/mochitest/chrome.ini b/toolkit/devtools/server/tests/mochitest/chrome.ini index 30ade2d2d88a..804bb3785967 100644 --- a/toolkit/devtools/server/tests/mochitest/chrome.ini +++ b/toolkit/devtools/server/tests/mochitest/chrome.ini @@ -78,6 +78,7 @@ skip-if = buildapp == 'mulet' [test_memory_allocations_04.html] [test_memory_allocations_05.html] [test_memory_allocations_06.html] +[test_memory_allocations_07.html] [test_memory_attach_01.html] [test_memory_attach_02.html] [test_memory_census.html] diff --git a/toolkit/devtools/server/tests/mochitest/test_memory_allocations_07.html b/toolkit/devtools/server/tests/mochitest/test_memory_allocations_07.html new file mode 100644 index 000000000000..c26c2d8ecbb9 --- /dev/null +++ b/toolkit/devtools/server/tests/mochitest/test_memory_allocations_07.html @@ -0,0 +1,55 @@ + + + + + + Memory monitoring actor test + + + + +
+
+
+
+ + diff --git a/toolkit/devtools/shared/memory.js b/toolkit/devtools/shared/memory.js index 508accb877ae..fe7d28fe66f0 100644 --- a/toolkit/devtools/shared/memory.js +++ b/toolkit/devtools/shared/memory.js @@ -226,6 +226,11 @@ let Memory = exports.Memory = Class({ * , * ... * ], + * allocationSizes: [ + * , + * , + * ... + * ], * frames: [ * { * line: , @@ -275,8 +280,9 @@ let Memory = exports.Memory = Class({ const packet = { allocations: [], allocationsTimestamps: [], + allocationSizes: [], }; - for (let { frame: stack, timestamp } of allocations) { + for (let { frame: stack, timestamp, size } of allocations) { if (stack && Cu.isDeadWrapper(stack)) { continue; } @@ -284,7 +290,7 @@ let Memory = exports.Memory = Class({ // Safe because SavedFrames are frozen/immutable. let waived = Cu.waiveXrays(stack); - // Ensure that we have a form, count, and index for new allocations + // Ensure that we have a form, size, and index for new allocations // because we potentially haven't seen some or all of them yet. After this // loop, we can rely on the fact that every frame we deal with already has // its metadata stored. @@ -292,6 +298,7 @@ let Memory = exports.Memory = Class({ packet.allocations.push(index); packet.allocationsTimestamps.push(timestamp); + packet.allocationSizes.push(size); } return this._frameCache.updateFramePacket(packet);