Closed mgmacias95 closed 1 year ago
There are two possible problems that this bug surfaces:
hwmBytes
is somehow undefined
.This seems to happen because in this case high_water_mark_by_snapshot
is an empty array.
I think at the very least this:
should be
if (hwms && hwms.length > 0) {
but I am curious if the fact that that is empty is expected @godlygeek. In any case, there is something more because there are more undefined
stuff.
I think this is enough to fix it:
diff --git a/src/memray/reporters/assets/temporal_flamegraph.js b/src/memray/reporters/assets/temporal_flamegraph.js
index d43a509..259e5f0 100644
--- a/src/memray/reporters/assets/temporal_flamegraph.js
+++ b/src/memray/reporters/assets/temporal_flamegraph.js
@@ -52,7 +52,7 @@ function packedDataToTree(packedData, rangeStart, rangeEnd) {
}
const hwms = packedData.high_water_mark_by_snapshot;
- if (hwms) {
+ if (hwms && hwms.length > 0 && memory_records.length > 0) {
console.log("finding highest high water mark in range");
let hwmSnapshot = rangeStart;
let hwmBytes = hwms[rangeStart];
Is there an existing issue for this?
Current Behavior
I made this simple script to test the new temporary flamegraphs feature:
I executed the following commands:
Then opened the flamegraph on my chrome browser. The flamegraph gets stuck on this loading view:
When checking the chrome dev console I can see the following error message:
Expected Behavior
An error message or a flamegraph.
Steps To Reproduce
Memray Version
1.8.0
Python Version
3.11
Operating System
macOS
Anything else?
No response