Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@matteodisabatino/gc_info
Advanced tools
Gives you information about V8 GC after its execution. Based on gc-stats.
Since version 1.0.0 the module supports all existing Node.js versions from 0.8 to the current release and binaries for Node.js 5+ are provided together; for prior versions module must be compiled.
Since version 1.2.0 the module supports all existing Electron versions from 0.3.1 to the current release and binaries for Electron 0.36.0+ are provided together; for prior versions module must be compiled.
It is a C++ addon written using the module nan and following the Google C++ Style Guide except for the lint. If you find something not compliant with, please provide a pull request.
In general every pull request that will:
are well accepted.
Require the module and subscribe the data
event.
const gcInfo = require('@matteodisabatino/gc_info')
gcInfo.on('data', info => {
console.log('GC information: ', info)
})
const gcInfo = require('@matteodisabatino/gc_info')
const listener1 = info => {
console.log('listener1 - GC information: ', info)
}
const listener2 = info => {
console.log('listener2 - GC information: ', info)
}
gcInfo.on('data', listener1)
gcInfo.on('data', listener2)
gcInfo.off('data', listener1) // listener1 is no longer active but
// you will still receive data via
// listener2.
const gcInfo = require('@matteodisabatino/gc_info')
const listener1 = info => {
console.log('listener1 - GC information: ', info)
}
const listener2 = info => {
console.log('listener2 - GC information: ', info)
}
gcInfo.on('data', listener1)
gcInfo.on('data', listener2)
gcInfo.off('data') // Both listener1 and listener2 are no longer
// active. You will not receive any data until you
// will subscribe the `data` event again.
{
startedAt: Number,
endedAt: Number,
duration: Number,
gctype: Number,
pre: {
totalHeapSize: Number,
totalHeapSizeExecutable: Number,
usedHeapSize: Number,
heapSizeLimit: Number,
totalPhysicalSize: Number,
totalAvailableSize: Number,
mallocedMemory: Number,
peakMallocedMemory: Number,
numberOfNativeContexts: Number,
numberOfDetachedContexts: Number,
externalMemory: Number,
totalGlobalHandlesSize: Number,
usedGlobalHandlesSize: Number
},
post: {
totalHeapSize: Number,
totalHeapSizeExecutable: Number,
usedHeapSize: Number,
heapSizeLimit: Number,
totalPhysicalSize: Number,
totalAvailableSize: Number,
mallocedMemory: Number,
peakMallocedMemory: Number,
numberOfNativeContexts: Number,
numberOfDetachedContexts: Number,
externalMemory: Number,
totalGlobalHandlesSize: Number,
usedGlobalHandlesSize: Number
},
diff: {
totalHeapSize: Number,
totalHeapSizeExecutable: Number,
usedHeapSize: Number,
heapSizeLimit: Number,
totalPhysicalSize: Number,
totalAvailableSize: Number,
mallocedMemory: Number,
peakMallocedMemory: Number,
numberOfNativeContexts: Number,
numberOfDetachedContexts: Number,
externalMemory: Number,
totalGlobalHandlesSize: Number,
usedGlobalHandlesSize: Number
}
}
startedAt: The moment the GC started (Unix timestamp in milliseconds).
endedAt: The moment the GC ended (Unix timestamp in milliseconds).
duration: The time the GC has been active (difference between endedAt and startedAt).
gctype: Memory allocation type. According to v8 source code possible values are:
totalHeapSize: Number of bytes V8 has allocated for the heap. This can grow if usedHeap needs more.
totalHeapSizeExecutable: Number of bytes for compiled bytecode and JITed code.
usedHeapSize: Number of bytes in use by application data.
heapSizeLimit: The absolute limit the heap cannot exceed.
totalPhysicalSize: Committed size. (Node.js 0.12+)
totalAvailableSize: Available heap size. (Node.js 4+)
mallocedMemory: Current amount of memory, obtained via malloc. (Node.js 7+)
peakMallocedMemory: Peak amount of memory, obtained via malloc. (Node.js 7+)
numberOfNativeContexts: Number of the top-level contexts currently active. Increase of this number over time indicates a memory leak. (Node.js 10+)
numberOfDetachedContexts: Number of contexts that were detached and not yet garbage collected. This number being non-zero indicates a potential memory leak. (Node.js 10+)
externalMemory: Number of bytes of memory allocated outside of v8's heap. (Node.js 12+)
totalGlobalHandlesSize: Size of all global handles in the heap. (Node.js 14+)
usedGlobalHandlesSize: Size of all allocated/used global handles in the heap. (Node.js 14+)
FAQs
Exposes node v8 garbage collection stats
The npm package @matteodisabatino/gc_info receives a total of 603 weekly downloads. As such, @matteodisabatino/gc_info popularity was classified as not popular.
We found that @matteodisabatino/gc_info demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.