Comments (3)
MemLab tests its APIs with Jest. Please check out the src/__test__
folder of each memlab packages for more examples.
To find memory leaks in SPA using Jest, here is one example:
https://github.com/facebookincubator/memlab/blob/main/packages/api/src/__tests__/API/E2EFindMemoryLeaks.test.ts
(more examples under the packages/api/src/__tests__
folder)
If you would like to analyze memory in node.js, MemLab provides the following APIs:
- Take heap snapshot from node.js:
https://facebookincubator.github.io/memlab/docs/api/modules/heap_analysis_src/#takenodefullheap - Analyzing the heap snapshot in graph view:
https://facebookincubator.github.io/memlab/docs/api/interfaces/core_src.IHeapSnapshot/
Here is an example of using MemLab with Jest:
https://facebookincubator.github.io/memlab/docs/api/interfaces/core_src.IHeapSnapshot/#hasobjectwithtagtag
from memlab.
I think the question was more like "Is there any way/functionality already that allows us to throw this tool onto our jest tests to find memory leaks in it".
At least thats my question, but after reading through the code, docs and examples I couldn't find anything.
from memlab.
Thank you very much @JacksonGL for the quick response, I will have a look at the MemLab tests and other materials.
from memlab.
Related Issues (20)
- Can't switch chrome version HOT 2
- Idea - Question - Discussion - Using memlab to refactor code targeting different framework philosphy HOT 1
- Question - How does it pull memory information ? HOT 1
- 老哥有点问题,本地默认安装你的仓库里面有个依赖包引入 colors 的包默认是1.4.2的 被污染的那个包 导致 启动不起来,windows 开发环境, HOT 2
- Is it possible to run multiple test scenarios from the same file at once? HOT 4
- How to handle error or exception if one of script file stop execution? HOT 1
- memlab is not accessible after installation HOT 2
- Login with redirection HOT 1
- Analyzing/taking heap snapshots of pages that become unresponsive from extreme leaks HOT 1
- Memory usage vs number of leaks across 2 different platforms HOT 4
- Having different puppeteer version in a project installs 6 additional browser instances HOT 4
- Could not find expected browser (chrome) locally HOT 6
- Documentation on where to take the "final" heap snapshot HOT 1
- How to set PuppeteerConfig correctly? HOT 6
- Invalid scenario file HOT 8
- Add ESM support for @memlab/api (and remaining) HOT 4
- Puppeteer browser.close() hangs on AWS Lambda HOT 2
- TypeError: core_1.utils.tryToMutePuppeteerWarning is not a function HOT 2
- Error occurs when executing scenarios involving dialog display HOT 1
- Need guidance on accessing elements in code using heap object ID HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memlab.