Created
October 7, 2013 21:58
-
-
Save wolfeidau/6875651 to your computer and use it in GitHub Desktop.
Leaking Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = {key: 'XXXX', secret:'XXXX'}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var url = require('url'); | |
var request = require('request'); | |
var creds = require('./creds.js'); | |
var scheme = 'https'; | |
var hostname = 'api.tempo-db.com'; | |
var baseUrl = scheme + '://' + hostname; | |
var auth = 'Basic ' + new Buffer(creds.key + ':' + creds.secret).toString('base64'); | |
var headers = { | |
Host: hostname, | |
Authorization: auth | |
}; | |
var seriesKey = '1_D90343085872CA9C_687_0_2000'; | |
function uploadEntry(cb){ | |
var data = []; | |
data.push({t: new Date(), v: Math.random() * 50}) | |
var opts = { | |
url: url.parse(baseUrl + '/v1/series/key/' + seriesKey + '/data/'), | |
method: 'POST', | |
headers: headers, | |
body: JSON.stringify(data) | |
} | |
console.log('sending', data[0]); | |
request(opts,cb); | |
}; | |
function callback(err, result){ | |
if (!err) console.log('statusCode', result.statusCode); | |
} | |
setInterval(uploadEntry.bind(null, callback), 1000); |
So with the addition of full gc.
31c96f17591 26 21 ReadableState: highWaterMark, buffer, ...
31c96e8d139 27 2 Object: encoding, flag
10a68790ef21 27 3 Object: name, email, url
31c96ef20e9 27 15 Array
10a687912b39 28 2 Object: url, type
31c96e9f999 30 12 PropertyDescriptor: value_, hasValue_, ...
31c96e048b1 33 4 NativeModule: filename, id, exports, ...
31c96e9d181 39 6 Array
31c96e8d641 44 3 Buffer: length, parent, offset
31c96ee37c1 45 13 Array
31c97e8dcd1 47 0
31c96ee2089 48 14 Array
31c96e94969 50 8 Array
10a687912389 52 7 Module: id, exports, parent, filename, ...
31c96e93d11 54 10 Array
31c96e954c1 56 9 Array
31c96e8cd31 56 11 Array
31c96e9d269 57 7 Array
31c96e8ca99 59 12 Array
31c96e8d291 62 13 <anonymous> (as <anon>): dev, mode, ...
31c96e94921 106 3 Array
31c96e9c489 113 4 Array
31c96e9c3b9 113 5 Array
31c96e8c709 163 2 Arguments: length, callee
31c96e93dd1 260 1 Array
31c96e8c791 425 2 Array
31c96e9a8f9 695 0 Object
31c96e082f1 1147 0 Array
pmap output.
[markw@38139342-096a-4f96-9e4d-843d0ca05af4 ~]$ pmap 19493
19493: node --expose-gc httptest.js
0000000000400000 7012K r-x-- /opt/local/bin/node
0000000000AE8000 28K rw--- /opt/local/bin/node
0000000000AEF000 26008K rw--- [ heap ]
0000031C96000000 8192K rw--- [ anon ]
0000031C96800000 4096K rw--- [ anon ]
0000031C96C00000 2048K rw--- [ anon ]
0000031C96E00000 1024K rw--- [ anon ]
0000031C96F00000 1024K rw--- [ anon ]
0000031C97000000 8192K rw--- [ anon ]
0000031C97800000 4096K rw--- [ anon ]
0000031C97C00000 2048K rw--- [ anon ]
0000031C97E00000 1024K rw--- [ anon ]
0000031C97F00000 1024K rw--- [ anon ]
0000050980900000 148K rw--- [ anon ]
000008A7D8100000 212K rw--- [ anon ]
000009746B100000 1024K rw--- [ anon ]
00000DF5837CE000 4K rw--- [ anon ]
00000DF5837CF000 4K rw--- [ anon ]
00000DF5837D0000 8K rw--- [ anon ]
00000DF5837D2000 16K rw--- [ anon ]
00000DF5837D6000 32K rw--- [ anon ]
00000DF5837DE000 64K rw--- [ anon ]
00000DF5837EE000 128K rw--- [ anon ]
00000DF58380E000 256K rw--- [ anon ]
00000DF58384E000 512K rw--- [ anon ]
00000DF5838CE000 1024K rw--- [ anon ]
000010A687900000 1024K rw--- [ anon ]
00001A4AAAF00000 532K rw--- [ anon ]
00001E41C1300000 1024K rw--- [ anon ]
000021EA63100000 1024K rw--- [ anon ]
0000238194800000 20K rw--- [ anon ]
0000238194806000 996K rwx-- [ anon ]
0000238194900000 20K rw--- [ anon ]
0000238194906000 996K rwx-- [ anon ]
0000238194A00000 20K rw--- [ anon ]
0000238194A06000 996K rwx-- [ anon ]
000023819AD00000 20K rw--- [ anon ]
000023819AD06000 996K rwx-- [ anon ]
000037E12ACC0000 128K rw--- [ anon ]
00003B038B400000 148K rw--- [ anon ]
00003DAE62C00000 1024K rw--- [ anon ]
FFFFFD7FFD7EF000 4K rw--R [ stack tid=7 ]
FFFFFD7FFD9EE000 4K rw--R [ stack tid=6 ]
FFFFFD7FFD9F0000 4K r-x-- /lib/amd64/libsendfile.so.1
FFFFFD7FFDA01000 4K rw--- /lib/amd64/libsendfile.so.1
FFFFFD7FFDC2E000 4K rw--R [ stack tid=5 ]
FFFFFD7FFDC30000 1044K r-x-- /opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64/libstdc++.so.6.0.17
FFFFFD7FFDD44000 40K rw--- /opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64/libstdc++.so.6.0.17
FFFFFD7FFDD4E000 84K rw--- /opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64/libstdc++.so.6.0.17
FFFFFD7FFDD70000 1840K r-x-- /opt/local/lib/libcrypto.so.1.0.0
FFFFFD7FFDF4B000 152K rw--- /opt/local/lib/libcrypto.so.1.0.0
FFFFFD7FFDF71000 12K rw--- /opt/local/lib/libcrypto.so.1.0.0
FFFFFD7FFDFD0000 400K r-x-- /opt/local/lib/libssl.so.1.0.0
FFFFFD7FFE043000 40K rw--- /opt/local/lib/libssl.so.1.0.0
FFFFFD7FFE170000 92K r-x-- /opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64/libgcc_s.so.1
FFFFFD7FFE196000 4K rw--- /opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64/libgcc_s.so.1
FFFFFD7FFE197000 4K rw--- /opt/local/gcc47/x86_64-sun-solaris2.11/lib/amd64/libgcc_s.so.1
FFFFFD7FFE57C000 8K rw--R [ stack tid=4 ]
FFFFFD7FFE57F000 4K r-x-- /lib/amd64/libdl.so.1
FFFFFD7FFE600000 8K r-x-- /lib/amd64/libkstat.so.1
FFFFFD7FFE612000 4K rw--- /lib/amd64/libkstat.so.1
FFFFFD7FFE82E000 4K rw--R [ stack tid=3 ]
FFFFFD7FFE830000 64K rwx-- [ anon ]
FFFFFD7FFEA3E000 4K rw--R [ stack tid=2 ]
FFFFFD7FFEA40000 68K r-x-- /lib/amd64/libsocket.so.1
FFFFFD7FFEA61000 4K rw--- /lib/amd64/libsocket.so.1
FFFFFD7FFEACD000 12K r-x-- /lib/amd64/libpthread.so.1
FFFFFD7FFEBC0000 8K r-x-- /lib/amd64/libumem_trampoline.so.1
FFFFFD7FFEBD2000 4K rw--- /lib/amd64/libumem_trampoline.so.1
FFFFFD7FFEBE0000 12K rwx-- /lib/amd64/libumem_trampoline.so.1
FFFFFD7FFEBF0000 476K r-x-- /lib/amd64/libumem.so.1
FFFFFD7FFEC77000 144K rw--- /lib/amd64/libumem.so.1
FFFFFD7FFEC9B000 44K rw--- /lib/amd64/libumem.so.1
FFFFFD7FFED10000 532K r-x-- /lib/amd64/libnsl.so.1
FFFFFD7FFEDA5000 12K rw--- /lib/amd64/libnsl.so.1
FFFFFD7FFEDA8000 32K rw--- /lib/amd64/libnsl.so.1
FFFFFD7FFEEE0000 388K r-x-- /lib/amd64/libm.so.2
FFFFFD7FFEF50000 20K rw--- /lib/amd64/libm.so.2
FFFFFD7FFEFB0000 128K rwx-- [ anon ]
FFFFFD7FFEFE0000 64K rwx-- [ anon ]
FFFFFD7FFF000000 4K r--s- dev:539,6 ino:703437881
FFFFFD7FFF010000 64K rwx-- [ anon ]
FFFFFD7FFF030000 64K rw--- [ anon ]
FFFFFD7FFF04F000 128K rw--- [ anon ]
FFFFFD7FFF070000 4K r-x-- [ anon ]
FFFFFD7FFF080000 4K r-x-- [ anon ]
FFFFFD7FFF090000 4K r-x-- [ anon ]
FFFFFD7FFF0A0000 4K r-x-- [ anon ]
FFFFFD7FFF0B0000 4K r-x-- [ anon ]
FFFFFD7FFF0C1000 4K rwxs- [ anon ]
FFFFFD7FFF0D0000 24K rwx-- [ anon ]
FFFFFD7FFF0E0000 4K rwx-- [ anon ]
FFFFFD7FFF0F0000 4K rwx-- [ anon ]
FFFFFD7FFF100000 1476K r-x-- /lib/amd64/libc.so.1
FFFFFD7FFF281000 40K rw--- /lib/amd64/libc.so.1
FFFFFD7FFF28B000 20K rw--- /lib/amd64/libc.so.1
FFFFFD7FFF2A0000 4K rwx-- [ anon ]
FFFFFD7FFF2B0000 4K rwx-- [ anon ]
FFFFFD7FFF2C0000 4K rwx-- [ anon ]
FFFFFD7FFF2D0000 4K rwx-- [ anon ]
FFFFFD7FFF2E0000 4K rwx-- [ anon ]
FFFFFD7FFF2F0000 4K rwx-- [ anon ]
FFFFFD7FFF300000 4K rwx-- [ anon ]
FFFFFD7FFF310000 4K rwx-- [ anon ]
FFFFFD7FFF320000 4K rwx-- [ anon ]
FFFFFD7FFF330000 4K rwx-- [ anon ]
FFFFFD7FFF340000 4K rwx-- [ anon ]
FFFFFD7FFF350000 4K rwx-- [ anon ]
FFFFFD7FFF360000 4K rwx-- [ anon ]
FFFFFD7FFF370000 4K rw--- [ anon ]
FFFFFD7FFF380000 4K rw--- [ anon ]
FFFFFD7FFF390000 4K rwx-- [ anon ]
FFFFFD7FFF398000 328K r-x-- /lib/amd64/ld.so.1
FFFFFD7FFF3FA000 12K rwx-- /lib/amd64/ld.so.1
FFFFFD7FFF3FD000 8K rwx-- /lib/amd64/ld.so.1
FFFFFD7FFFDF5000 44K rw--- [ stack ]
total 86300K
Diff of pmap.
$ diff pmap.out.1 pmap.out.2
1c1
< 19493: node --expose-gc httptest.js
---
> 19493: node --expose-gc httptest.js
17c17
< 000009746B100000 1024K rw--- [ anon ]
---
> 00000D5428700000 1024K rw--- [ anon ]
38,39c38,40
< 000023819AD00000 20K rw--- [ anon ]
< 000023819AD06000 996K rwx-- [ anon ]
---
> 00002381AED00000 20K rw--- [ anon ]
> 00002381AED06000 996K rwx-- [ anon ]
> 00002A0475000000 1024K rw--- [ anon ]
42d42
< 00003DAE62C00000 1024K rw--- [ anon ]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After running for 15 minutes or so.
From mdb i get.