Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
SciChartTeam committed Aug 2, 2024
2 parents 4290cf3 + 10235fa commit 3a09498
Show file tree
Hide file tree
Showing 31 changed files with 22,228 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## What's in this repo?

1. The source code for [demo.scichart.com](https://demo.scichart.com) found under the **[/Examples](Examples)** folder
2. Source code for **tutorials** for SciChart.js, found under the **[/Tutorials](Tutorials)** folder
2. Source code for **tutorials** for SciChart.js, found under the **[/Tutorials](Tutorials)** folder;
also examples for testing and profiling memory usage at **[/Tutorials/MemoryTests](Tutorials/MemoryTests)**
3. **Sandbox examples**, including boilerplates for React, Angular, Vue, Electron, Next.js and Nuxt.js plus several useful examples found under the **[/Sandbox](Sandbox)** folder
4. Supporting code for the **documentation**, which is published online at [scichart.com/javascript-chart-documentation](https://scichart.com/javascript-chart-documentation) is found in the **[/Documentation](Documentation)** folder

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
node_modules/
45 changes: 45 additions & 0 deletions Tutorials/MemoryTests/ChartInitializationAndCleanup/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SciChart.js Chart Initialization and Cleanup Test

The purpose of this app is to serve as a testing boilerplate for charts to check for memory consumption and potential leaks.
It allows to create surfaces of different types (2D and 3D) with different `wasmContext` ownership options:

- Single - a surface with a separate `wasmContext` ( initialized via `createSingle`)
- Multi - a surface with a shared `wasmContext` ( initialized via `createSingle`)

Also it allows to delete surfaces one by one or simultaneously.
There are also an option to delete shared `wasmContext` (both 2D and 3D) and test `autoDisposeWasmContext` options.

The app demonstrates a usage of internal memory and performance debug utils.
The Memory Debug utils require the app to be run in development mode.

Before running the example get familiarized with related documentation:

[Memory Best Practices](https://www.scichart.com/documentation/js/current/webframe.html#MemoryBestPractices.html)
[Memory Leak Debugging](https://www.scichart.com/documentation/js/current/webframe.html#MemoryLeakDebugging.html)

## Running the project

Setup:
`npm install`

Run in development mode:
`npm run dev`
Run in production mode:
`npm run build`
`npm start`

## How to use

We recommend testing this example both in a regular manner and by trying to force the garbage collection.
Also, perform testing on a freshly opened tab with incognito mode.

Prepare the browser dev tools to be able to force a garbage collection and taking a heap snapshot.

### Data Series update without initial capacity

Force garbage collection and make a heap snapshot with dev tools.
Press some "Create Chart" buttons to initialize surfaces.
Then use appropriate "Delete" buttons.
During the process consider making snapshots, logging debug output.

Experiment with different params
Loading

0 comments on commit 3a09498

Please sign in to comment.