Skip to content

Instantly share code, notes, and snippets.

@jandrieu
Created July 25, 2013 21:18
Show Gist options
  • Save jandrieu/6083874 to your computer and use it in GitHub Desktop.
Save jandrieu/6083874 to your computer and use it in GitHub Desktop.
Leaker.js memory leak generator using dbus-native
#!/usr/local/bin/node
var dbus = require('dbus-native');
var memwatch = require('memwatch');
var bus;
bus = dbus.sessionBus({socket: '/var/run/dbus/system_bus_socket'});
bus.connection.on('error',function(err){
console.log("Error on dbus connection: " +JSON.stringify(err,null,2));
})
function leak() {
bus.invoke({
type: dbus.messageType.methodCall,
path:'/org/freedesktop/DBus',
destination: 'org.freedesktop.DBus',
member: "ListNames",
}, function invokeCallback(err,res){
if(err) {
console.log("Error invoking:" + err);
}
});
};
memwatch.on('leak', function memwatchLeak(info) {
console.log('*********************** LEAK *****:'+JSON.stringify(info));
});
setInterval(leak,10);
@jpatoyon
Copy link

jpatoyon commented Aug 5, 2013

Any luck tracking down where the leak is happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment