DOC: write_heap_snapshot (#164)

This commit is contained in:
Joffrey JAFFEUX 2020-05-18 07:16:11 +02:00 committed by GitHub
parent 4f40f41ce4
commit 23e0369720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -315,6 +315,16 @@ context.eval("a = 2")
# nothing works on the context from now on, its a shell waiting to be disposed
```
A MiniRacer context can also be dumped in a heapsnapshot file using `#write_heap_snapshot(file_or_io)`
```ruby
context = MiniRacer::Context.new(timeout: 5)
context.eval("let a='testing';")
context.write_heap_snapshot("test.heapsnapshot")
```
This file can then be loaded in the memory tab of the chrome dev console.
### Function call
This calls the function passed as first argument: