Open In App

Memory Inspector Tool in Microsoft Edge Browser

The Memory Inspector Tool is used to view Array Buffer and also provide the ASCII representation of the data present in the memory. Typed Array. In the tool the developer inspect different types of memory objects and check if correct values are present in correct memory location.

Overview of Memory Inspector Tool

The tool is used to monitor the memory buffer of JS objects. It provides a view of the memory location which when clicked displayed the value of the memory location along with values of different type such as integer, float, pointer values and with different numeric base which can be decimal, octal or hexadecimal. The tool also provides the respective ASCII value of the memory location which is helpful to deal with ASCII characters in memory buffer.



Features of Memory Inspector Tool

The various features of Memory Inspector Tool are:

Benefits of Memory Inspector Tool

The various benefits of using the Memory Inspector Tool are:



When to use Memory Inspector Tool?

The various reasons to use this tool are:

How to open Memory Inspector Tool in Edge

The tool is present in DevTools and you can open DevTools by pressing F12 or “Ctrl+Shift+I” or right-clicking in the webpage and then pressing inspect from the context menu that appears. In DevTools there are multiple ways to open the tool which are:

Opening Memory Inspector Tool in Various Ways

Understanding the UI of Memory Inspector Tool

The UI of the Memory Inspector Tool in divide into 3 sections.

  1. Opened Buffer Tabs
  2. Memory Buffer Section
  3. Values Section

UI of Memory Inspector Tool

Opened Buffer Tabs

All the opened Array Buffer have its own tab in the Memory Inspector Tool. You can close these tab by using the cross button present in each tab or rearrange these tab by dragging to the place you want.

Opened Tabs

Memory Buffer Section

The section provides the respective memory locations used by the buffer. On the left you have all the respective address that follow after the last value which is present in the middle section immediate left of the ASCII section. The ASCII values are representation of the actual value in memory.

The top part contain all buttons of this section. Left move from left to right and understand each button.

Memory Buffer Section

Values Section

The section displays various types of values regarding the selected memory address. These values are different size of Integer, Float and Pointer and by default expressed in Little Endian. The drop down option present along with the value type label is used to change the numeric base of the values that is displayed and the possible numeric base are dec (decimal), hex (hexadecimal) and oct (octal).

The arrow button at it end of pointer values jumps to the next active memory address but if it’s greyed out then there is no next active memory address.

Values Section

Customizing the view:

You can change the Endianness from Little Endian to Big Endian and toggle the type of values to be displayed using the gear icon

Changing Endianness and Toggling Values

Example: Inspecting a Array Buffer from Sources Tab




const buffer = new Int16Array(50);
const copyBuffer = new Int16Array(10);
const str = 'A example for memory inspector';
  
for (var i = 0; i < 50; i++) {
    buffer[i] = str.charCodeAt(i);
    copyBuffer[i] = buffer[i];
}
  
console.log(buffer);




<!DOCTYPE html>
<html lang="en">
  
<head>
    <title>Example</title>
    <script src="./app.js"></script>
</head>
  
<body>
    <h1>This is an example for Memory Inspector tool</h1>
</body>
  
</html>

Output:

Opening a Array Buffer in Memory Inspect tab from Sources tab

Explanation: You can view a array buffer in Memory Inspector tab from the Sources Tab by adding a breakpoint and then selecting the “Reveal in Memory Inspector panel” button under the Scope section. If the webpage using JS then add breakpoint in the file which name ends with “.js” but in web assembly site add breakpoint in file which name ends with “.wasm”. Always refresh the page after adding breakpoint.

Conclusion

When developers need to check on the memory buffer they can use this tool. The tool provides a good view of the memory and also these values are represented in ASCII representation. You can compare and check different values data type and also change the endianness of the value.


Article Tags :