You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cheerp/reference/75-memory-profiler.md
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,17 @@
2
2
title: Cheerp Memory Profiler
3
3
---
4
4
5
-
Starting from Cheerp 2.0, [commercial users](https://leaningtech.com/cheerp/#Pricing) have access to the Cheerp Memory Profiler. This tool allows one to monitor memory use in real-time, and profile memory to identify leaks or inefficiencies.
5
+
> [!warning]Cheerp nightly only
6
6
7
-
The Cheerp memory profiler can be used from within the source code (e.g: to assert that there are no leaks inside a certain block) or from the browser console. We provide a visualisation tool that can be simply included in the HTML page hosting compiled code to get an overview of real-time memory consumption during the application lifetime. [Commercial Licence].
7
+
The Cheerp Memory Profiler tool allows one to monitor memory use in real-time, and profile memory to identify leaks or inefficiencies.
8
+
9
+
The Cheerp Memory Profiler can be used from within the source code (e.g: to assert that there are no leaks inside a certain block) or from the browser console. We provide a visualisation tool that can be simply included in the HTML page hosting compiled code to get an overview of real-time memory consumption during the application lifetime.
8
10
9
11
## Requirements
10
12
11
-
The Cheerp memory profiler is built specifically for tracking allocations on WebAssembly memory (i.e. the linear memory heap). JavaScript memory can be profiled using the existing, browser-integrated developer tools.
13
+
The Cheerp Memory Profiler is built specifically for tracking allocations on WebAssembly memory (i.e. the linear memory heap). JavaScript memory can be profiled using the existing, browser-integrated developer tools.
14
+
15
+
## Usage
12
16
13
17
To use the tool, you need to link the memprof library to your C/C++ project compiled with Cheerp, for example:
14
18
@@ -20,7 +24,7 @@ We recommend using the -cheerp-pretty-code command line options to get readable
20
24
21
25
## Memory usage graph
22
26
23
-
You can use the `memprofui.js` visualiser to get a real-time view of memory usage. Once you have a file compiled with the memprof library, you only need to add a script tag and initialise the visualiser. The visualiser component needs to access the DOM, so it can only be used for code running in the main thread (i.e. not a WebWorker).
27
+
The memprof library includes a visualiser to get a real-time view of memory usage. Once you have a program linked with the memprof library, you can use the `CheerpMemUI` js-exported class. The visualiser component needs to access the DOM, so it can only be used for code running in the main thread (i.e. not a WebWorker).
24
28
25
29
```html
26
30
<!doctype html>
@@ -31,8 +35,6 @@ You can use the `memprofui.js` visualiser to get a real-time view of memory usag
31
35
</head>
32
36
<body>
33
37
<scriptsrc="target.js"></script>
34
-
<!-- Add this line, telling the page to load the UI -->
0 commit comments