You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export PREFIX="$HOME/opt/cross"export PATH="$PREFIX/bin:$PATH"
wget https://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.gz
tar -xf gdb-7.8.tar.gz
rm gdb-7.8.tar.gz
mkdir build-gdb
cd build-gdb
../gdb-7.8/configure --target=x86_64-pc-linux-gnu --prefix="$PREFIX"
make
make install
varu8array=kernel.takeHeapSnapshot();// returns array of snapshot Uint8Array chunks
Example to send snapshot over TCP for inspection:
console.log('taking snapshot...');varbufs=kernel.takeHeapSnapshot();console.log('connecting...');varsocket=newruntime.net.TCPSocket();socket.onopen=function(){console.log('pushing snapshot into socket...');for(letbufofbufs){socket.send(buf);}socket.close();console.log('done');};socket.open('192.168.1.2',5555);
It might take a while for TCP to transmit full snapshot depending on heap size.
Snapshot receiver:
nc -l 5555 > 1.heapsnapshot
Snapshot could be loaded into Chrome's profiles tab for inspection.
Memory info
kernel.memoryInfo();
Returns kernel memory usage. Object with properties (all values in bytes):
heapUsed - js heap used
heapTotal - js heap size
pmUsed - physical memory used
pmTotal - physical memory total (available for allocation)