Comments (7)
By the way I implemented MAT's algorithm on V8 heap snapshots in JavaScript: https://github.com/joyeecheung/v8-mat
The algorithm probably does not work on core dump (or heap snapshots converted from core dumps) yet because we don't have enough GC root information in the post-mortem metadata (I suppose it should be possible to expose GC Root indexes to the metadata though). The algorithm starts by iterating the GC roots in the heap and look at their dominated nodes.
from llnode.
I agree it's probably not possible to tell which objects are leaking from one dump.
Memory Analyzer for Java (http://www.eclipse.org/mat/) generates a dominator tree which shows you which references are keeping large chunks of the heap alive. For Java it's been an excellent technique for finding what's hanging on to object references and keeping large amounts of data alive. That often identifies the culprit in a leak situation from just one dump.
I think in both llnode and the v8 heap dumps we're missing the sort of detailed heap root information that we'd need to generate that though.
There's some background reading here:
https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Fconcepts%2Fdominatortree.html
https://en.wikipedia.org/wiki/Dominator_(graph_theory)
from llnode.
When would an object be considered leaked? With a GC, an object is either reachable from the root set or it's garbage - there are no malloc-without-free leaks like you have in C.
from llnode.
It is pretty much impossible to figure out, I'm afraid. The only way it could work is by comparing two core dumps and seeing which objects are common to both of them. Would this work for your use-case @brendangregg ?
from llnode.
@hhellyer Heap snapshots let you calculate the retained size of an object; sum its object graph and keep track of cycles. Is that what you mean?
Aside: I remember discussing turning core dumps into heap snapshots (with you? not sure). That would cover that use case.
from llnode.
This has to be rewritten: https://github.com/indutny/core2dump
from llnode.
@bnoordhuis - I don't think the two are quite the same the dominator tree algorithm works out which object is responsible for keeping that retained space alive. Memory Analyzer shows retained size too but the dominator tree view shows how things are kept alive. (I'm going to struggle to explain it properly - it's definitely worth reading up on or trying out in Memory Analyzer.)
from llnode.
Related Issues (20)
- Rename primary branch to main HOT 4
- llnode failed to install HOT 12
- Not showing details of JS frames on node v16.14.0 HOT 6
- ptrace: No such process. HOT 2
- Document User Journey HOT 11
- core dump collaboration call HOT 27
- Supported Features Matrix HOT 1
- Reinstate 19 Nightly Build HOT 1
- Apply env variables to test timeouts consistently
- 'v8 findjsobjects' command is failing with below the stack trace - need help HOT 4
- discussion: Re-establish automation to detect breaking changes HOT 2
- refactor: use `debug_helper`
- tests: Fix flaky JSArrayBuffer test HOT 3
- bug(print-source): libc++abi: terminating with uncaught exception
- no coverage for "v8 nodeinfo" HOT 4
- [question] emtpy result when read core file HOT 2
- cannot load core file HOT 1
- Consistent crashes with `v8 findrefs -s` HOT 1
- Unable to load LLDB with LLNODE plugin HOT 2
- [Question] examining coredumps on Mac x86 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 llnode.