Skip to content

Commit cac1c03

Browse files
bates64yuri91
andauthored
Cheerp Memory Profiler (#85)
Co-authored-by: Yuri Iozzelli <[email protected]>
1 parent 16cbc6c commit cac1c03

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
title: Cheerp Memory Profiler
33
---
44

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
66
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.
810

911
## Requirements
1012

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
1216

1317
To use the tool, you need to link the memprof library to your C/C++ project compiled with Cheerp, for example:
1418

@@ -20,7 +24,7 @@ We recommend using the -cheerp-pretty-code command line options to get readable
2024

2125
## Memory usage graph
2226

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).
2428

2529
```html
2630
<!doctype html>
@@ -31,8 +35,6 @@ You can use the `memprofui.js` visualiser to get a real-time view of memory usag
3135
</head>
3236
<body>
3337
<script src="target.js"></script>
34-
<!-- Add this line, telling the page to load the UI -->
35-
<script src="https://cheerp.leaningtech.com/memprofui.js"></script>
3638
<!-- There are two parameters, the length in seconds of the profiling window and
3739
how often the samples should be registered in milliseconds.
3840
Here 60 seconds and sampling every 100ms-->

0 commit comments

Comments
 (0)